Boas!
Estou com um problema para contar os registros no ResultSet. Eu tentei pelos métodos last() e getRow(), mas recebo a mensagem “The ‘last()’ method is only allowed on scroll cursors”. Existe algo que eu possa fazer para conseguir contar os registros em minha tabela??
public int contaRegistros()throws SQLException{
Statement stm = con.createStatement();
ResultSet rst = stm.executeQuery("SELECT * FROM APP.LIVRO");
rst.last();
return rst.getRow();
}