dimanche 6 mars 2016

Android database error, from retrieving Blob type.

I'm getting an error while I run this Query:

public List<byte[]> getImageBlobs() {
        List<byte[]> list = new ArrayList<>();
        Cursor cursor = database.rawQuery("SELECT imageBlob FROM boardgames", null);
        cursor.moveToFirst();
        while (!cursor.isAfterLast()) {
            list.add(cursor.getBlob(0));
            cursor.moveToNext();
        }
        cursor.close();
        return list;
}

Database structure from DB Browser for SQLite

enter image description here

From logcat:

03-06 10:43:51.342 10469-10469/? E/SQLiteLog: (1) no such column: imageBlob
03-06 10:43:51.343 10469-10469/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com.boardgamehelper.boardgamehelper, PID: 10469
                                                   android.database.sqlite.SQLiteException: no such column: imageBlob (code 1): , while compiling: SELECT imageBlob FROM boardgames
                                                       at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)

Aucun commentaire:

Enregistrer un commentaire