【发布时间】:2021-07-02 03:34:54
【问题描述】:
此代码返回空光标。这里有什么问题? 数据已经存在于 sqlitedb 中。
public static final String COL_2 = "ID";
public static final String COL_3 = "TYPE";
public Cursor checkData(String id, String type){
SQLiteDatabase db = getWritableDatabase();
Cursor res = db.rawQuery("SELECT * FROM "+ TABLE_NAME + " WHERE " + COL_2 + " = " + id+ " AND " + COL_3 + " = " + type , null);
return res;
}
【问题讨论】:
标签: android-sqlite