Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- btnSingin.setOnAction(new EventHandler<ActionEvent>() {
- @Override
- public void handle(ActionEvent t) {
- Connection conn ;
- ResultSet rs ;
- PreparedStatement pst ;
- conn = SQLConnection.connectDB();
- String sqlString = "select * from Admin where username=? and password=? ";
- try {
- pst = conn.prepareStatement(sqlString);
- pst.setString(1, txtUsername.getText());
- pst.setString(1, txtpassword.getText());
- rs = pst.executeQuery();
- if (rs.next()) {
- JOptionPane.showMessageDialog(null, " Username And Password Was Correct ");
- } else {
- JOptionPane.showMessageDialog(null, " Username And Password Not Was correct . . . ");
- }
- } catch (Exception e) {
- System.out.println(e);
- }
- }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement