本文介绍了PostgreSQL的JDBC连接上Android 4.0的失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道我能做些什么,使上Android 4.0的JDBC连接的工作。它工作正常,在Android 1.6-2.3。我用戴夫克拉默的构建:
<一href=\"http://groups.google.com/group/pgandroid/browse_thread/thread/d8b400f039f66d5f/f77b2e2a99370a36?lnk=raot#f77b2e2a99370a36\" rel=\"nofollow\">http://groups.google.com/group/pgandroid/browse_thread/thread/d8b400f039f66d5f/f77b2e2a99370a36?lnk=raot#f77b2e2a99370a36

Does anyone knows what can I do to make JDBC connection work on Android 4.0. It works fine on Android 1.6-2.3. I use Dave Cramer's build:http://groups.google.com/group/pgandroid/browse_thread/thread/d8b400f039f66d5f/f77b2e2a99370a36?lnk=raot#f77b2e2a99370a36

在LogCat中说:

06-10 17:35:51.043: E/AndroidRuntime(798): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.belonogov.connectjdbc/com.belonogov.connectjdbc.ConnectJDBCActivity}: java.lang.NullPointerException
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.app.ActivityThread.access$600(ActivityThread.java:123)
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.os.Handler.dispatchMessage(Handler.java:99)
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.os.Looper.loop(Looper.java:137)
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.app.ActivityThread.main(ActivityThread.java:4424)
06-10 17:35:51.043: E/AndroidRuntime(798):
at java.lang.reflect.Method.invokeNative(Native Method)
06-10 17:35:51.043: E/AndroidRuntime(798):
at java.lang.reflect.Method.invoke(Method.java:511)
06-10 17:35:51.043: E/AndroidRuntime(798):
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-10 17:35:51.043: E/AndroidRuntime(798):
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-10 17:35:51.043: E/AndroidRuntime(798):
at dalvik.system.NativeStart.main(Native Method)
06-10 17:35:51.043: E/AndroidRuntime(798): Caused by: java.lang.NullPointerException
06-10 17:35:51.043: E/AndroidRuntime(798):
at com.belonogov.connectjdbc.ConnectJDBCActivity$CustomDrawableView.<init>(ConnectJDBCActivity.java:81)
06-10 17:35:51.043: E/AndroidRuntime(798):
at com.belonogov.connectjdbc.ConnectJDBCActivity.onCreate(ConnectJDBCActivity.java:27)
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.app.Activity.performCreate(Activity.java:4465)
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
06-10 17:35:51.043: E/AndroidRuntime(798):
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
06-10 17:35:51.043: E/AndroidRuntime(798):
... 11 more

这只是一个简单的应用程序连接到数据库。

It's just a simple application that connects to a database.

推荐答案

如果可能的话,考虑直接使用JDBC的Andr​​oid设备上移离。它在往返等方面效率低,而且是不稳健的连接不可靠的脸。

If at all possible, consider moving away from direct JDBC on your android device. It's inefficient in terms of round trips, etc, and isn't robust in the face of unreliable connections.

请参阅。

这篇关于PostgreSQL的JDBC连接上Android 4.0的失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 08:39