Query returing no results codename one <p>Query showing no results and not giving any error .control not entering inside the if block help me out that where is the mistake i am doing ? i have tried many ways to get the result but all in vain. When i tried the following before the if statement </p> <pre><code>int column=cur.getColumnCount(); Row row=cur.getRow(); row.getString(0); </code></pre> <p>then i got the resultset closed exception</p> <pre><code>Database db=null; Cursor cur=null; System.out.print("Printing from accounts class "+Email+Password); String [] param={Email,Password}; System.out.print(param[0]+param[1]); try{ db=Display.getInstance().openOrCreate("UserAccountsDB.db"); cur= db.executeQuery("select * from APPUserInfo WHERE Email=? AND Password=?",(String [])param); int columns=cur.getColumnCount(); if(columns &gt; 0) { boolean next = cur.next(); while(next) { Row currentRow = cur.getRow(); String LoggedUserName=currentRow.getString(0); String LoggedUserPassword=currentRow.getString(1); System.out.println(LoggedUserName); next = cur.next(); } } }catch(IOException ex) { Util.cleanup(db); Util.cleanup(cur); Log.e(ex); } finally{ Util.cleanup(db); Util.cleanup(cur); } </code></pre>