android - ORMLite get Could not get next result for class Error -
i'm using ormlite library in android , error random , dont know whats , how modrate:
caused by: java.lang.illegalstateexception: not next result class [ljava.lang.string; @ com.j256.ormlite.stmt.selectiterator.next
i error when i'm using method single column :
public static list getsinglecolumn(string query) { list<string> columnes = null; try { columnes = g.category.queryraw(query, new rawrowmapper<string>() { @override public string maprow(string[] columnnames, string[] resultcolumns) throws android.database.sqlexception { return resultcolumns[0]; } }).getresults(); } catch (sqlexception e) { e.printstacktrace(); } return columnes; }
or code:
list unread_messages = g.dbhelper.getsinglecolumn("select sum(read_status) messageslist");
try change method this:
public static string getsinglecolumn(string query) { string columnes = null; try { columnes = g.category.queryraw(query, new rawrowmapper<string>() { @override public string maprow(string[] columnnames, string[] resultcolumns) throws android.database.sqlexception { return resultcolumns[0]; } }).getfirstresult(); } catch (sqlexception e) { e.printstacktrace(); } return columnes; }
Comments
Post a Comment