This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
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

Win a copy of The Software Craftsman this week in the Agile forum!
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
Have you tried LearnNowOnline?
subject: ResultSet object