Print statements generated by Android SQLiteOpenHelper
I have an update statement that does not work properly and want to know how the final statement looks like. Is there a way to print out the statements generated by the Android SQLiteOpenHelper?
So far I mana开发者_C百科ged to get a hold of the unpopulated statement by stepping through the stacktrace:
UPDATE banks SET fav=? WHERE code = ? AND name = ?
The syntax of the unpopulated statement is correct.
You might want to try to use a SQLiteQueryBuilder in addition to the SQLiteOpenHelper. You can use the buildQuery()
method, which returns a string, to get the output of the query statement and the query()
method, which returns a cursor, to run a query.
精彩评论