JDBC 2.0 includes a better way to get the number of results returned by the ResultSet.

Java Code:
Statement s = 
   conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, 
               ResultSet.CONCUR_READ_ONLY);
ResultSet r = 
   s.executeQuery("SELECT * FROM employee WHERE id_emp LIKE '1%'");
r.last();
count = r.getRow();
r.beforeFirst();