Android : Android 设备是否支持 JDBC? [英] Android : Is JDBC supported in Android devices?

查看:35
本文介绍了Android : Android 设备是否支持 JDBC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个使用 JDBC 将数据发送到数据库的 Android 应用程序,而不使用任何 Web 服务.我使用 Android 2.2 模拟器做了一个实验,我能够将数据发送到 MySQL DB (LOCALHOST).之后我尝试使用 Android 2.2 设备发送,我将路径从jdbc:mysql://10.0.2.2:3306/jdbc:mysql://xx.xx.xx.xx:3306/.

I am doing an Android application using JDBC to send data to database without using any web services. I did an experiment using Android 2.2 emulator and I am able to send data to MySQL DB (LOCALHOST). After that I tried to send using Android 2.2 device, I changed the path from jdbc:mysql://10.0.2.2:3306/ with jdbc:mysql://xx.xx.xx.xx:3306/.

xx.xx.xx.xx 来自我的本地主机的 ipconfig.但它在设备中不起作用.可能是什么原因.

xx.xx.xx.xx is from ipconfig of my localhost machine. But it is not working in the device. What could be the reason.

主要疑点:

  1. Android 设备当前是否支持 JDBC?
  2. Android 2.2 是否支持 JDBC?
  3. 如果支持,哪些 Android 版本将支持 JDBC?

推荐答案

是的.您必须记住将 JDBC 连接代码放在 AsyncTask 中,否则你会烧伤烧伤!

Yes. You must remember to put your JDBC connection code in an AsyncTask, otherwise you will BURN BURN BURN!

这篇关于Android : Android 设备是否支持 JDBC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆