Advertisement
Guest User

Untitled

a guest
Apr 4th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. btnSingin.setOnAction(new EventHandler<ActionEvent>() {
  2. @Override
  3. public void handle(ActionEvent t) {
  4. Connection conn ;
  5. ResultSet rs ;
  6. PreparedStatement pst ;
  7. conn = SQLConnection.connectDB();
  8. String sqlString = "select * from Admin where username=? and password=? ";
  9.  
  10. try {
  11. pst = conn.prepareStatement(sqlString);
  12. pst.setString(1, txtUsername.getText());
  13. pst.setString(1, txtpassword.getText());
  14. rs = pst.executeQuery();
  15. if (rs.next()) {
  16. JOptionPane.showMessageDialog(null, " Username And Password Was Correct ");
  17. } else {
  18. JOptionPane.showMessageDialog(null, " Username And Password Not Was correct . . . ");
  19. }
  20. } catch (Exception e) {
  21. System.out.println(e);
  22. }
  23. }
  24. }
  25. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement