puoi fare così
rs.last();
rs.getRow();
dopo ti riposizioni all'inizio con first()