• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Paging in JDBC 2

 
Armita Bansal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a provision for paging in JDBC2? I want to retrieve say only rows numbered 20000 to 30000 from a query which will give me a million rows.
ie..
20000-30000 records of the query
"select * from amillionrowtable"
 
Rob Godfrey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JDBC2 spec now offers the ability to jump about in the result set. See methods absolute(), relative(), previous(), first() and last() in the javadoc for java.sql.ResultSet.
 
Armita Bansal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob..
but my question is a little different. I can set a fetch Size on the query for the first N rows. but my requirement is a range 10000-20000 row, say. what about this?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic