• Post Reply Bookmark Topic Watch Topic
  • New Topic

ResultSet object

 
L. Riley
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I retrieve the number of records in a ResultSet?
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
------------------
Bosun
SCJP for the Java� 2 Platform
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is more appropriate for the JDBC forum. I will move it there for you.
Matthew Phillips
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!