Thread: ResultSet size
View Single Post
  #7 (permalink)  
Old 06-22-2008, 06:30 AM
fishtoprecords's Avatar
fishtoprecords fishtoprecords is offline
Senior Member
 
Join Date: Jun 2008
Posts: 255
fishtoprecords is on a distinguished road
Quote:
Originally Posted by bugger View Post
Code:
select count(*) from tablename where ...
I do this all the time. What problem do you have?
You have to use a relative resultSet.getInteger(0));
to pull the value out, since "count(*)" is not named, but it works great.

Its bad form to get all the individual records (as others have suggested) when all you want is the count(*) value

You can do this for other functions, such as min(fieldX), max(), etc.
Reply With Quote