[SQLiteJDBC] Select statement is not returning all the rows in a table

Raihan -Ul - Islam raihan1780 at gmail.com
Mon Oct 31 18:34:12 EDT 2011


HI,

I am new guy in sqlite. I am quering a table using the following command .
It returns only first 4 row . Not all the row in table. Can any one tell me
wht is the problem


               try
{
 Class.forName("org.sqlite.JDBC");
 }
catch (ClassNotFoundException e)
 {
// TODO Auto-generated catch block
 e.printStackTrace();
}
 try {
connection = DriverManager.getConnection(DataSource);

} catch (SQLException e) {
 // TODO Auto-generated catch block
e.printStackTrace();
 }
                 if(statement == null)
statement = connection.createStatement();
 long xxlastID=this.getLastIDFrmDB();//Its my own function to get the
lastid. LastID contains till which the function read data previously
 if (xxlastID==0)
 {
resultSet = statement.executeQuery("SELECT * FROM out;");
 }else
 {
resultSet = statement.executeQuery("SELECT * FROM out where
ID>"+xxlastID+";");
  }
while (resultSet.next())
        {

 LastIDFrmDB=Integer.parseInt(resultSet.getString("ID"));
             setLastIDFrmDB(LastIDFrmDB);
             //System.out.println(LastIDFrmDB);
        }
//return msgListS;
 } catch (Exception e) {
// TODO Auto-generated catch block

 e.printStackTrace();
}

Thanks
Raihan


More information about the SQLiteJDBC mailing list