java - Column Index not finding a column that definitely exists -


try {     cursor c = db.rawquery("select time updatetimes type = 'root'", null);     long time = c.getlong(c.getcolumnindex("time")); } catch (cursorindexoutofboundsexception e) {  } 

this exception gets thrown, though column "time" exists, the same query returns data expected when using sqlite3 client. ideas?

the cursor not @ valid index. need move first:

if (c.movetonext()) {     time = c.getlong(c.getcolumnindex("time")); } 

Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -