From the
JDBC FAQ
18. There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?
No, but it is easy to find the number of rows. If you are using a scrollable result set, rs, you can call the methods rs.last and then rs.getRow to find out how many rows rs has. If the result is not scrollable, you can either count the rows by iterating through the result set or get the number of rows by submitting a query with a COUNT column in the SELECT clause.
I believe scrollable result sets were introduced in JDBC 2.0, so I think you are stuck with one of the two latter solutions.
[ February 12, 2004: Message edited by: Joe Ess ]