Glenny, The two most common alternatives are to do a separate query of: "select count(*) from ... " or to count the rows as you loop through the data. The first is better if you just need to know how many rows there are. The second is better if you need to loop through the data anyway.
A third possibility, if your Driver supports JDBC 3 is to use rs.afterLast() to move to the end and then rs.getRow() to get the row number. I always do it one of the ways listed by Jeanne.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.