Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet

 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to get the data of row 5th from ResultSet directly, rather than go by next()?
Thanks
 
Bjarki Holm
Author
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simon,
yes, with JDBC 2.0, you can create scrollable result sets, and use ResultSet.absolute(rownumber); to jump to a specific row. Consult http://java.sun.com/products/jdk/1.2/docs/api/java/sql/ResultSet.html for more information.
Regards,

------------------
Bjarki Holm
Author of Professional Java Data
 
Anil Vupputuri
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If ur working JDBC1.X better get result set and dump it into some collection classes as it faster to retrieve without any network traffic to database. U can also work with querie's like retrieving nth record from collection classes(eg. Hashtable, Vector).
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it. Thanks,
Simon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic