What is the Best way to export a bunch of strings from an android app to a mySQL database?
将一堆字符串从Android应用程序导出到mySQL数据库的最佳方法是什么?
I've looked all over the place. All over here and all over the internet. I have found a bunch of different answers but nothing really makes sense.
我到处都看了。遍布这里和整个互联网。我找到了一堆不同的答案,但没有什么真正有意义的。
Should I use an AsyncTask or a HTTPclient? I also looked at the Microsoft JDBC database export but that also didn't really make any sense to me. Thanks for any help.
我应该使用AsyncTask还是HTTPclient?我还查看了Microsoft JDBC数据库导出,但这对我来说也没有任何意义。谢谢你的帮助。
edit: I need to add the data to the mySQL database table.
编辑:我需要将数据添加到mySQL数据库表。
1 个解决方案
#1
0
You can do it with JDBC connector and JDBC API. I've tested with connector mysql-connector-java-3.0.17-ga-bin.jar and works perfect and fast. You'll need an asynctask for this or a Runnable in own thread to avoid locking UI thread and risking killing your apk.
您可以使用JDBC连接器和JDBC API执行此操作。我已经使用连接器mysql-connector-java-3.0.17-ga-bin.jar测试并且工作完美且快速。你需要一个asynctask for this或一个Runnable在自己的线程中,以避免锁定UI线程和冒着杀死你的apk的风险。
Check here for an example
点击这里查看示例
#1
0
You can do it with JDBC connector and JDBC API. I've tested with connector mysql-connector-java-3.0.17-ga-bin.jar and works perfect and fast. You'll need an asynctask for this or a Runnable in own thread to avoid locking UI thread and risking killing your apk.
您可以使用JDBC连接器和JDBC API执行此操作。我已经使用连接器mysql-connector-java-3.0.17-ga-bin.jar测试并且工作完美且快速。你需要一个asynctask for this或一个Runnable在自己的线程中,以避免锁定UI线程和冒着杀死你的apk的风险。
Check here for an example
点击这里查看示例