Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean login(String actEmail, String actPassword){
- String sql = "SELECT Email AND Password FROM volontari WHERE Email = ? AND Password = ?";
- ResultSet res = null;
- try (Connection conn = connector.getConnection();
- PreparedStatement stmt = conn.prepareStatement(sql)) {
- stmt.setString(1, actEmail);
- stmt.setString(2, actPassword);
- stmt.executeQuery();
- if (res == null){
- return true;
- }else
- return false;
- } catch (SQLException ex) {
- System.out.println(ex.getMessage());
- }
- finally {
- try {
- if (res != null) res.close();
- } catch (SQLException e) {
- System.out.println(e.getMessage());
- }
- }return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement