Advertisement
Guest User

Untitled

a guest
Jan 1st, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. private void btn_loginActionPerformed(java.awt.event.ActionEvent evt) {
  2. rs =db.querySelectAll(" users "," username=' "+txt_username.getText()
  3. +"' and password='"+ txt_password.getText()+"'");
  4. //System.out.println("La requête est bien passée");
  5.  
  6. try {
  7.  
  8. while(rs.next()){
  9. username1 =rs.getString("username");
  10. password1 =rs.getString("password");
  11. hak = rs.getString("type");
  12.  
  13. }
  14. }catch (SQLException ex){
  15. Logger.getLogger(Login.class.getName()).log(Level.SEVERE,null, ex);
  16. }
  17. if((username1 == null) && (password1 == null)){
  18. JOptionPane.showMessageDialog(this,"le nom utilisateur ou le mot de pass est incorrect");
  19.  
  20. }else {
  21. if (hak.equals("directeur")){
  22. Principale h = new Principale();
  23. h.setVisible(true);
  24. this.dispose();
  25. }else{
  26. Cachier k = new Cachier();
  27. k.setVisible(true);
  28. this.dispose();
  29. }
  30.  
  31.  
  32. }
  33. } `
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement