I am trying to do a database connectivity in my android emulator, the problem is i am doing a servlet program that includes sqlite connectivity in it, but when i download the war file and run it from the jetty server, I am getting the following error: "org.sqlite.jdbc java.lang.classnotfound exeption"
I have been trying for days but could'nt get this database connectivity from my android emulator working, Could someone please help me, Here is my code,
Class.forName("org.sqlite.JDBC");
Connection conn=DriverManager.getConnection("jdbc:sqlite:webapps/DbTes/TestData.db");
Statement stat=conn.createStatement();
stat.executeUpdate("drop table if exists tbl_countries;");
stat.executeUpdate("create table tbl_countries (id INTEGER PRIMARY KEY AUTOINCREMENT, country_name TEXT);");
PreparedStatement prep = conn.prepareStatement("insert into tbl_countries(country_name) values (?);");
prep.setString(1, "a");
prep.addBatch();
prep.setString(1, "b");
prep.addBatch();
prep.setString(1, "c");
prep.addBatch();
conn.setAutoCommit(false);
prep.executeBatch();
conn.setAutoCommit(true);"
Thanks...
Using the jetty, send the information to the Mobile in any format such as JSON or XML. Parse data in the mobile application end. Create the database and save it using the SQLITE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With