class not found exception in android

后端 未结 3 626
旧巷少年郎
旧巷少年郎 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: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.

提交回复
热议问题