wood burning stoves 2.0*
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
Author

ResultSet object

L. Riley
Greenhorn

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.
------------------
Bosun
SCJP for the Java� 2 Platform


Bosun (SCJP, SCWCD)
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
 
Consider Paul's rocket mass heater.
 
subject: ResultSet object