sqlite - UPDATE Query not Working with Android App -
i writing android app needs execute update
query on sqlite database, reason, query not having effect when run it.
here's function supposed execute query.
public void query() { try { cursor = this.db.rawquery("update data set saved=1 number=1", null); } catch(sqliteexception e) { system.out.println("database query failed: " + e.getcause().getmessage()); } }
although query not work, not output catch
clause, , adding additional catch
check exception
not output either.
what's problem? how can update
queries work? have not tried executing insert
query, need later on. have similar issues queries write database?
use execsql()
, not rawquery()
run sql.
rawquery()
compiles sql not run it. execsql()
both compiles , runs sql.
Comments
Post a Comment