I am trying to connect to a database in my Android emulator, the problem is that I am making a servlet program that includes an SQL connection in it, but when I load the war file and run it from the berth server, I get the following error: " org.sqlite.jdbc java.lang.classnotfound exeption "
I have been trying for several days, but I canβt get this database connection from my Android emulator, can 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...
source share