1
Well... I did some classes, and it was time to connect to search for a data in the bank; Ok. He had already connected with the BD, however, when I did the class to fetch the data, he keeps giving nullException, as if the bank did not exist. Loot:
public void executeSQL(String sql){
try {
stm = conn.createStatement(rs.TYPE_SCROLL_INSENSITIVE,rs.CONCUR_READ_ONLY);
rs = stm.executeQuery(sql);
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro:" + e);
}
}
Then I search like this:
csql.executeSQL("select * from usuarios");
then the error occurs (But of course I instated);
Help me out, please.
Put the stacktrace
– Gedson Silva
Put Error. Another way you are not closing connections.
– Krismorte