ResultSet: Count rows before calculating offset