title: Does CachedRowSet work with all ResultSet implementations?
body: <p>I'm trying to implement a database paging solution (forward only required) using a <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/CachedRowSet.html" rel="nofollow noreferrer"><code>CachedRowSet</code></a> to page an <a href="http://publib.boulder.ibm.com/iseries/v5r1/ic2924/info/rzahh/javadoc/com/ibm/as400/access/AS400JDBCResultSet.html" rel="nofollow noreferrer"><code>AS400JDBCResultSet</code></a> containing the results of my query.</p>
  
  <p>I've tried using the</p>
  
  <pre><code>CachedRowSet cachedRowSet = new CachedRowSetImpl();
  cachedRowSet.setMaxRows(10);
  cachedRowSet.setPageSize(10);
  cachedRowSet.populate(resultSet);
  </code></pre>
  
  <p>approach, but the full result set (65 records) is returned in the first page (i.e. by calling <code>cachedRowSet.next()</code>). I've also tried the</p>
  
  <pre><code>CachedRowSet cachedRowSet = new CachedRowSetImpl();
  cachedRowSet.setPageSize(10);
  cachedRowSet.setMaxRows(0);
  cachedRowSet.setUsername("username");
  cachedRowSet.setPassword("password");
  cachedRowSet.setUrl("jdbc:as400://dev;naming=system;libraries=*LIBL;prompt=false;");
  cachedRowSet.setCommand(query);
  cachedRowSet.execute(connection);
  </code></pre>
  
  <p>approach, but I get the following exception thrown on the <code>execute()</code> call</p>
  
  <pre><code>Exception in thread "main" java.lang.AbstractMethodError: java/sql/DatabaseMetaData.locatorsUpdateCopy()Z
      at com.sun.rowset.CachedRowSetImpl.initMetaData(CachedRowSetImpl.java:712)
      at com.sun.rowset.CachedRowSetImpl.populate(CachedRowSetImpl.java:617)
      at com.sun.rowset.internal.CachedRowSetReader.readData(CachedRowSetReader.java:190)
      at com.sun.rowset.CachedRowSetImpl.execute(CachedRowSetImpl.java:756)
  </code></pre>
  
  <p>I've tried on both IBM &amp; Sun JREs.</p>
  
  <p>Any ideas? Is this functionality just plain not supported by my JDBC driver?</p>
  
  <p><strike><strong>Update:</strong> Also happens with MySQL driver - so I must be doing something else wrong, right?</strike></p>
  
  <p><strong>Update (2):</strong> Have got it to work on Java 5.0 &amp; 6.0 for MySql's <code>Driver</code>, but only on 6.0 for my <code>AS400JDBCDriver</code> - both using method 2 from above. Seems to be quite slow in any case.</p>