我正在迁移所有与sql相关的代码以使用Sqlbrite。目前我的代码看起来像这样:
Cursor cursor;
String name;
String[] selectionArgs = { name };
cursor = database.query(MySQLiteHelper.TABLE_USER, new String[] {"id"}, "name = ? COLLATE NOCASE AND ", selectionArgs, null, null, null);现在我需要使用SqlBrite,但是我想对它使用预准备语句。我有没有办法做到这一点?我在谷歌上搜索了“SqlBrite PreparedStatement”,但找不到任何关于这方面的信息。
发布于 2017-03-03 00:12:21
可以,您可以在您的BriteDatabase实例上使用executeInsert和executeUpdateDelete。它们接受SQLiteStatement作为参数。
https://stackoverflow.com/questions/42548242
复制相似问题