This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Count the Records Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Count the Records" Watch "Count the Records" New topic

Count the Records

Jagmohan Negi

Joined: Aug 24, 2005
Posts: 27
How can i count the number of records returned by a resultset.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Rajesh Agarwal
Ranch Hand

Joined: Aug 01, 2005
Posts: 79
Before running your query, run a select count(*) for your query
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1082

Use Scrollable ResultSet !! and then you can use this code


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
I agree. Here's the link:
subject: Count the Records
It's not a secret anymore!