Thread: ResultSet size
View Single Post
  #2 (permalink)  
Old 12-14-2007, 12:53 PM
felixtfelix felixtfelix is offline
Member
 
Join Date: Dec 2007
Posts: 32
felixtfelix is on a distinguished road
Actually There is no direct way to get the no of rows in the resultset. I can suggest one way. Make the resultSet scrollable. Then

rs.last

rs.getRow() which will give you the no of the current row.

Or

you can make use of a counter in the while loop

int recordCount =0;
while(rs.next())
{

recordCount++;
}

This will do?
Reply With Quote