I'm trying to use the SQLite rawQuery method, based on the code here:
Android record exists() in database?
...but I get "The method rawQuery(String, String[]) is undefined for the type OdaaDBOpenHelper Authorize_Activity_DynamicControls.java" with this code:
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 {
I tried it both using the instance name of my SQLiteOpenHelper-derived class, and using the class name itself (commented out in the code above).
What must I do to implement rawQuery() or cause it to be recognized/acknowledged?