dimanche 15 février 2015

query from id to id in SQLite

i wanna to get query from an id to an id so i used this code:



public List<Convers> getConversation(long min,long max){
List<Convers> queryconvlist = new ArrayList<Convers>();
Cursor querycursor = database.query(dbHelper.getTableName(1),null, DatabaseHandler.ConvID+" >= "+String.valueOf(min)+" AND " + " < "+String.valueOf(max), null, null, null, null);

querycursor.moveToFirst();
while (!querycursor.isAfterLast()) {
Convers queryconversation = cursorToConv(querycursor);
queryconvlist.add(queryconversation);
querycursor.moveToNext();
}
querycursor.close();
return queryconvlist;
}


but the app has crashed and logcat is


02-15 12:30:06.600: E/SQLiteLog(413): (1) near "<": syntax error


Aucun commentaire:

Enregistrer un commentaire