Bonsoir;
j'ai un projet à faire
et jeveux faire une simple fenetre d'authentification.
voilà le code du bouton principal
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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) {
 
        }
    }
quand j'appuie aucun bug
juste ça n'affiche rien et la fenetre d'authentification est toujours
j'utilise une bd mysql
merci