How do I use prepared statements in SQlite in Android?
jasonhudgins example won't work. You can't execute a query with stmt.execute()
and get a value (or a Cursor
) back.
You can only precompile statements that either returns no rows at all (such as an insert, or create table statement) or a single row and column, (and use simpleQueryForLong()
or simpleQueryForString()
).