aspose file tools*
The moose likes JDBC 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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Count the Records" Watch "Count the Records" New topic
Author

Count the Records

Jagmohan Negi
Greenhorn

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

Joined: Apr 14, 2004
Posts: 10336


or:


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: 1081

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




Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Count the Records
 
Similar Threads
Database Record or User Record?
Pagination best practices
records not showing in ResultSet
java.sql.SQLException: Exhausted Resultset
Using Struts to iterate over queries with aggregates