I am using this way to try to bring the latest information registered in the sql server, but for some unknown reason it is not working. I searched in several forums and apparently the same method I'm using is used:
Class.forName(Auxiliar1.AcessoBanco.getDriver());
Connection con = DriverManager.getConnection(Auxiliar1.AcessoBanco.getUrl(), Auxiliar1.AcessoBanco.getUser(), Auxiliar1.AcessoBanco.getPass());
String query1 = "Select MAX(ExtA_IndParafuso) FROM L11";
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(query1);
jTextField6.setText(rs.toString());
JOptionPane.showMessageDialog(null, rs.getInt(0));
I'm trying to get the result in Joptionpane
or in Jtextfield
format for testing.
I used it that way to try to bring the values and even then to no avail.
int valor = rs.getInt(0);
jTextField6.setText(String.valueOf(valor));