class not found exception in android

后端 未结 3 616
旧巷少年郎
旧巷少年郎 2020-12-22 05:21

I am using following code for SQLConnection in android:

public void queryResultSet(String CommandSQL) throws ClassNotFoundException, java.sql.SQLException
           


        
相关标签:
3条回答
  • 2020-12-22 06:05

    right click on the project - properties - java build path - Order and export - tick Android private libraries and all the libraries that u added

    0 讨论(0)
  • 2020-12-22 06:08

    If you have already added the jtds-1.2.5 driver, good. Otherwise:

    Right click on the Project > Properties > Libraries Tab Add the jtds-1.2.5.jar file by clicking on "Add External JARs"

    Next, in the Order and Export tab (Right next to Libraries in the Java Build Path window) check the box for jtds-1.2.5.jar (and any other external jars you might have).

    This will export the .jar containing the driver with the .apk file.

    0 讨论(0)
  • 2020-12-22 06:11

    If you use ProGuard, then your class may be dropped by it because it is used with reflection only. And if you don't, Android can still fail to load class for some reasons. Look at LogCat during your package installation.

    0 讨论(0)
提交回复
热议问题