I am having doubts when using SQLEXCEPTION.
For example, I create a Station and ResultSet I put a SELECT.
So far everything is normal, however, I can not do the treatives for or-01403 .
I am doing the following:
try
{
jTextField2.setText("");
Statement stmtUsuario = conn.createStatement ();
ResultSet Usuario = stmtUsuario.executeQuery("SELECT NM_USUARIO "+
"FROM USUARIO "+
"WHERE CD_USUARIO = '"+jTextField1.getText()+"'");
while (Usuario.next())
{
jTextField2.setText(Usuario.getString(1));
}
}
catch(SQLException exemp)
{
JOptionPane.showMessage(null,"Usuário não cadastrado.!");
}
Would anyone know how I can treat this kind of excession?