Guest User

teo gill kebab

a guest
May 10th, 2016
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. String userlogin;
  2. String userpassword;
  3. userlogin = userloginfield.getText();
  4. userpassword = userpassfield.getText();
  5. userloginfield.setText("");
  6. userpassfield.setText("");
  7. try{
  8. SqlHandler sh = new SqlHandler("databas");
  9. ResultSet rs = sh.query("select password from user1337.T1 where username='"+userlogin+"'");
  10. if(rs.next()){
  11. String pass = rs.getString("password");
  12. if(pass.equals(userpassword)){
  13. textarea1.setText("Success!");
  14. }else{
  15. textarea1.setText("Failed!");
  16. }
  17. }
  18. sh.close();
  19. } catch (Exception ex){
  20. ex.printStackTrace();
  21. System.out.println("Error!");
  22. }
Add Comment
Please, Sign In to add comment