1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try{
query="select from employe where id='"+jTextField1.getText()+"' and mdp='"+jPasswordField1.getText()+"'";
st=cn.createStatement();
rset=st.executeQuery(query);
cn.commit();
if(rset.next())
{
JOptionPane.showMessageDialog(null, "id et mot de passe correct");
menuprincipal m=new menuprincipal();
m.setVisible(true);
this.dispose();
}
else
{
JOptionPane.showMessageDialog(null, "id et mot de passes incorrects" );
jTextField1.setText("");
jPasswordField1.setText("");
}
}catch (SQLException e) {
}
} |
Partager