GeeCON Prague 2014*
The moose likes JDBC and the fly likes ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet" Watch "ResultSet" New topic
Author

ResultSet

Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
Is it possible to get the data of row 5th from ResultSet directly, rather than go by next()?
Thanks
Bjarki Holm
Author
Ranch Hand

Joined: May 25, 2001
Posts: 65
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


Bjarki Holm
Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
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).

SCJP 1.5, SCEA, ICED (287,484,486)
Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
I got it. Thanks,
Simon
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ResultSet