This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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:
subject: ResultSet object
Similar Threads
handle empty recordset
Problem in getting multiple resultsets from Oracle Stored Procedure
how can show the data in database to jtable??