开发者

Print statements generated by Android SQLiteOpenHelper

开发者 https://www.devze.com 2023-03-18 02:17 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消