private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        String Sql = "Select * from administrateur where adresse_mail= ? and mot_de_passe = ? ";
        String Sql1 = "Select * from  clients where adresse_mail= ? and mot_de_passe = ? ";
        String Sql2 = "Select * from  pharmacien where email= ? and mot_de_passe = ? ";

        try{
            //0
             PreparedStatement ps = MyConnection.getInstance().prepareStatement(Sql);
         
        ps.setString(1,tf_mail.getText());
        ps.setString(2,tf_psw.getText());
        
        rs=ps.executeQuery();
                    

        if(rs.next()){
            
        JOptionPane.showMessageDialog(null,"e_mail et Mot de passe valide");
        administrateur_simple a = new administrateur_simple();
        a.setVisible(true);
        dispose();
        
        }
        
        else {
            //1
            //JOptionPane.showMessageDialog(null,"e_mail ou Mot de passe invalide");
        PreparedStatement ps1 = MyConnection.getInstance().prepareStatement(Sql1);
         
        ps1.setString(1,tf_mail.getText());
        ps1.setString(2,tf_psw.getText());
        
        rs=ps1.executeQuery();
        
        
        if(rs.next()){
            
        JOptionPane.showMessageDialog(null,"e_mail et Mot de passe valide");
        //client_inter a = new client_inter();
        //a.setVisible(true);
        dispose();
        
        
        }
         else {
            //2
            //JOptionPane.showMessageDialog(null,"e_mail ou Mot de passe invalide");
        PreparedStatement ps2 = MyConnection.getInstance().prepareStatement(Sql2);
         
        ps2.setString(1,tf_mail.getText());
        ps2.setString(2,tf_psw.getText());
        
        rs=ps2.executeQuery();
        
        if(rs.next()){
            
        JOptionPane.showMessageDialog(null,"e_mail et Mot de passe valide");
        MenuView a = new MenuView();
        a.setVisible(true);
        dispose();
        
        
        }
         else {
            JOptionPane.showMessageDialog(null,"e_mail ou Mot de passe invalide");
        }
        }
        }
        }
        catch(Exception e )
        {
            JOptionPane.showMessageDialog(null,e);
            
        
        }
    }//GEN-LAST:event_jButton1ActionPerformed