java - No data in cursor -


i´ve got application reads , writes in sqlite-database.

public void insertkind(int id, string name, string geburtsdatum, string geschlecht){         long rowid = 1;         try{         sqlitedatabase db = getwritabledatabase();         contentvalues cv = new contentvalues();          cv.put(name, name);         cv.put(geburtsdatum, geburtsdatum);         cv.put(geschlecht, geschlecht);         try{             rowid = db.insert(table_name_kind, null, cv);         }         catch(exception e){             system.out.println("des derf ma neeeeeeeeeeed seng!!!!");         }          db.close();     }     catch (sqliteexception e){         log.e(tag, "insert()", e);     }     finally{         log.d(tag, "rowid");     } } 

with following code want select data database:

public cursor select(){         sqlitedatabase db = getreadabledatabase();         cursor cursor = db.query(table_name_kind, new string[] {"_id", "name", "geburtsdatum", "geschlecht"},                  "" + "", null, null, null, null);         system.out.println(cursor.getcount());         return cursor;     } 

i used similiar code in different application. problem cursor.getcount() 0, there no exceptions when insert data. name, geburtsdatum , geschlecht have values.

i can´t check database adb because doesn´t work on computer. problem?

if cursor.getcount() get's 0 query execute on database.

i think problem may in clause , try set null instead "" + ""

cursor cursor = db.query(table_name_kind, new string[] {"_id", "name", "geburtsdatum", "geschlecht"}, null, null, null, null, null); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -