【问题标题】:Use PreparedStatement with Sqlbrite将 PreparedStatement 与 Sqlbrite 一起使用
【发布时间】:2017-03-02 06:25:14
【问题描述】:

我正在迁移所有与 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,但我想使用 Prepared Statement。有什么办法可以做到这一点?我用谷歌搜索了“SqlBrite PreparedStatement”,但找不到任何相关信息。

【问题讨论】:

    标签: android android-sqlite sqlbrite


    【解决方案1】:

    是的,您可以在您的 BriteDatabase 实例上使用 executeInsertexecuteUpdateDelete。他们接受 SQLiteStatement 作为参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-08
      • 2017-11-17
      • 1970-01-01
      • 1970-01-01
      • 2016-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多