File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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!