Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Connection conn = null;
- ResultSet rs = null;
- PreparedStatement pst = null;
- public void actionPerformed(ActionEvent e) {
- try {
- String sql = "SELECT * FROM `loginform` where users=? and password=?";
- pst = conn.prepareStatement(sql);
- pst.setString(1, users.getText());
- pst.setString(2, password.getText());
- rs = pst.executeQuery();
- if(rs.next()) {
- JOptionPane.showMessageDialog(null, "YES!");
- } else {
- JOptionPane.showMessageDialog(null, "NO!");
- }
- }catch (Exception e1) {
- JOptionPane.showMessageDialog(null, e1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement