Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting Error while Using CachedRowSetImpl why its occour

843859Dec 29 2005 — edited Dec 30 2005
CachedRowSet crs = new CachedRowSetImpl();
DBConnector connector=new DBConnector("conf/conf.properties");
Connection con=connector.getConnection();// getting database conncection
    
String sql="Select * from "+TablName;
crs.setPageSize(10);
crs.setCommand(sql);
crs.execute(con);
int row = 0;
int page = 0;
 while(crs.nextPage()) -------------->Error Line
    {
      while(crs.next()) 
      {
        row++;
        String col1 = crs.getString("CustomerID");
        System.out.println(col1 + row + page );
      } 
           page++;
       } 

       crs.close();
       con.close();

  }
//---------------Exception :
java.sql.SQLException: Populate data before calling
at com.sun.rowset.CachedRowSetImpl.nextPage(Unknown Source)
at Test.main(Test.java:28)

---------------Exception ://



I am not getting why its giving error ,when i use without pagination it works fine.I am using CachedRowSetImpl by sun
rowset.jar (Release 1.0.1 available from http://java.sun.com/products/jdbc/download.html)

How to resolve it Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 27 2006
Added on Dec 29 2005
4 comments
539 views