Skip to content
Advertisement

Retrieving image from SQLite Database (BLOB data type)

I have tried to retrieve the byte[] from my SQLite DB using the code:

JavaScript

Error returned:

JavaScript

Advertisement

Answer

Your query:

JavaScript

returns only 1 column and since the column indices in a cursor are 0 based, you should retrieve it with:

JavaScript

Also, you should use moveToFirst() to check if the cursor returned any rows before retrieving the column’s value:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement