hi everyone i'm developping a java Swing application on Netbeans in this block i have some issues when i try to authentify with login and password using an SQL request the problem is that everytime i reveive the SQL exception message :"erreur gerant"
if (user.getText().equals("root") & pwd.getText().equals("rootouss")) {
admindao.sauthentifier(ad) ;
EspaceGerant eg = new EspaceGerant();
JOptionPane.showMessageDialog(null,"Bienvenue Administrateur");
eg.setVisible(true);
dispose();
} else if("root" != user.getText() & "rootouss" != pwd.getText()){
String sqlGerant ="Select * from gerant where login=?,password=?";
try {
PreparedStatement pst= conn.prepareStatement(sqlGerant);
pst.setString(1, user.getText());
pst.setString(2, pwd.getText());
rs=pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null,"Bienvenue Gerant");
GerantBundle gerBun = new GerantBundle();
gerBun.setVisible(true);
dispose();
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null,"erreur Gerant ");
}
}
ex.printStackTrace()into your catch block.