jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes ResultSet object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ResultSet object " Watch "ResultSet object " New topic

ResultSet object

L. Riley

Joined: Mar 20, 2001
Posts: 28
How do I retrieve the number of records in a ResultSet?
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You can do a select count(*) on the querry you plan to execute, or if your are usung JDBC 2.0 you can move to the last row in your resultset using yourresultsetobject.last() and then get your record count based fo the row number.
You may want to do a search in the JDBC forum. It has been discussed there several times.
SCJP for the Java� 2 Platform

So much trouble in the world -- Bob Marley
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
This is more appropriate for the JDBC forum. I will move it there for you.
Matthew Phillips

Matthew Phillips
I agree. Here's the link: http://aspose.com/file-tools
subject: ResultSet object
It's not a secret anymore!