Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Boolean userLogin(String username, String password) throws Exception {
- Boolean bool = null;
- try{
- Connection con = getConnection();
- PreparedStatement query = con.prepareStatement("SELECT * FROM users WHERE Username=? AND Password=?");
- query.setString(1, username);
- query.setString(2, password);
- ResultSet result = query.executeQuery();
- if(result.next()) {
- bool = true;
- }
- } catch(Exception e) {
- System.out.println(e);
- }
- return bool;
- }
Add Comment
Please, Sign In to add comment