SQLiteStatement execute a SELECT / INSERT / DELETE / UPDATE

前端 未结 2 1626
滥情空心
滥情空心 2021-01-18 13:58

I\'m using a compiled SQLiteStatement with transactions in optimizing SQLite transactions but I\'m reading the documentation for the execute function:

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-18 14:17

    Use SQLiteDatabase instead of SQLiteStatement for intereacting with your database. SQLiteStatements are not Thread safe so I would not use them for SELECT / INSERT / DELETE / UPDATE. Also you should try not to use raw database queries for anything other than Selects. There are built in helper functions that will increase your database performance. On your instance of SQLiteDatabase you have .insert, .update, .delete and I use .rawQuery for Selects.

提交回复
热议问题