我試圖使用SQLite rawQuery方法的基礎上,這裏的代碼:我必須做什麼來實現SQLite的rawQuery()方法?
Android record exists() in database?
...但我得到「方法rawQuery(字符串,字符串[])是不確定的與此代碼鍵入OdaaDBOpenHelper Authorize_Activity_DynamicControls.java「:
OdaaDBOH = new OdaaDBOpenHelper(this);
. . .
private boolean RecordExists(String _id) {
// This:
Cursor cursor = OdaaDBOH.rawQuery("select 1 from NAPOLEON_DYNAMITE_TABLE where _id=%s",
// or this:
//Cursor cursor = OdaaDOdaaDBOpenHelperBOH.rawQuery("select 1 from
NAPOLEON_DYNAMITE_TABLE where _id=%s",
new String[] { _id });
boolean exists = (cursor.getCount() > 0);
cursor.close();
return exists;
}
. . .
// from referenced unit:
public class OdaaDBOpenHelper extends SQLiteOpenHelper {
我它既使用我SQLiteOpenHelper派生類的實例名稱,並使用類 名本身試過(COMM在上面的代碼中列出)。
我該怎麼做才能實現rawQuery()或使它被識別/確認?