10-31-2012 03:14 AM
Now I'm playing with SQLite. I already created the table, and wanted to put data into it.
Statement stmt = null;
try {
URI uri = URI.create("/SDCard/BlackBerry/album.db");
db = DatabaseFactory.open(uri);
db.beginTransaction();
stmt = db.createStatement("INSERT INTO album(album_ID, album_key) " +
"VALUES ("+ editID.getText() +","+ editKey.getText() +")" );
stmt.prepare();
stmt.execute();
Dialog.inform("Database has been updated!");
}
catch (DatabaseIOException dbioe){
System.out.println(dbioe.getMessage());
}
catch (MalformedURIException me){
System.out.println(me.getMessage());
}
catch (DatabaseException dbe){
System.out.println(dbe.getMessage());
}
finally {
try {
stmt.close();
db.commitTransaction();
db.close();
} catch (DatabaseException e) {
e.printStackTrace();
}
}
}Every time I run the code, I get this "SQL logic error or missing database". Any help?
10-31-2012 04:24 AM