Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello
I created one data base and one table and insert the data but while inserting i am getting the
exception "INSERT INTO Employee(Name,ID) VALUES ('Naveen',23): SQL logic error or missing database"
Here is my code..

******************************************************************************

private void insertData(String text, int i) {
// TODO Auto-generated method stub

try {
URI uri = URI.create("file:///SDCard/Databases/database1.db");
sqliteDB = DatabaseFactory.open(uri);
Statement st = sqliteDB.createStatement(
"INSERT INTO Employee(Name,ID) " +
"VALUES ('"+text+"',23)");

st.prepare();
st.execute();
st.close();
sqliteDB.close();
}
catch ( Exception e ) {
System.out.println( e.getMessage() );
e.printStackTrace();
}

}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900