Skip to content Skip to sidebar Skip to footer

What Must I Do To Implement Sqlite's Rawquery() Method?

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

Solution 1:

rawQuery() is a method on SQLiteDatabase, not SQLiteOpenHelper. Call getReadableDatabase() or getWritableDatabase() on your SQLiteOpenHelper to get a SQLiteDatabase.

Solution 2:

From that question correct answer:

Consider that mDb is your SqlLiteDatabase class...

OdaaDBOH should be an instance of a SQLiteDatabase if you want to use rawQuery on it, most likely you are providing the implementation of a SQLiteOpenHelper there, which of course doesn't have a method rawQuery.

Post a Comment for "What Must I Do To Implement Sqlite's Rawquery() Method?"