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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -