my android application uses SQLITE. when i try to retrieve data from a certain table, everything works fine except for one column in particular which is of type varchar and holds a huge text (base64 string which will be coverted to a file).
when i try to retrieve any other column from this table, the retrieval is successful, but on this column i get the error:
java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow. Make sure the
Cursor is initialized correctly before accessing data from it.
Here is my code:
String Filequery= "Select FileName from Hyperlinks_GVT where Taskcode='"+currentTaskCode+"'
and Name='"+tempItem.getText()+"'";
Log.d(TAG,"Query is: "+Filequery);
try {
cursor3 = MainActivity.myDataBase.rawQuery(Filequery, null);
String Data="";
byte[] btData;
if (cursor3 != null && cursor3.moveToFirst()){
do {
Data=cursor3.getString(cursor3.getColumnIndex("FileName"));
} while (cursor3.moveToNext());
}
cursor3.close();
the table:
CREATE TABLE [Hyperlinks_GVT](
[ID] integer PRIMARY KEY AUTOINCREMENT NOT NULL,
[Taskcode] [int] NOT NULL,
[TaskYear] [int] NOT NULL,
[Name] [varchar](100) NOT NULL,
[FileName] [varchar] NOT NULL,
[Notes] [varchar](200) NOT NULL,
[UserID] [nvarchar](50) NOT NULL,
[CreationDT] [varchar](100) NOT NULL)
FIleName is the column with the large data NOTE: when i execute the query in Firefox using SQLITE Manager, the query retrieves the results, so the query is fine and has no errors. any help would be appreciated.