android mysql 驱动,如何到Android与MySQL使用MySQL JDBC驱动程序连接

I want to get data from table in MySQL and to show it in TextView, but I have some problems when I try to connect with database.

I'm using Eclipse for Android, and when I try to get data from MySQL in Java Project it works, but when I use Android Project it doesn't work.

Does anyone know how can I connect MySQL with Android Project using MySQL JDBC driver?

Or to give me other advice how to connect Android Project with MySQL?

解决方案

Android by default does not support MySQL. It has an in-built database i.e SQLite.

If you are trying to access MySQL database remotely, you should expose interface to this database with any standard web service.

E.g you could create RESTful Web Service on Server Side which is written using Java/PHP etc. and MySQL Connector. (Which you have already done!)

And your Android App could talk to this service with the URL generated using this web service.

Again, this question has been repeated previously, so you can check those solutions.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值