public boolean doLogin(String username, String password){
        PreparedStatement preparedStatement;
        ResultSet resultSet;
        String dbPassword = null;
        PasswordService passwordService = new DefaultPasswordService();
        Connection connection = DatabaseConnection.connectDB();
        // be conservative: make this the default
        boolean loginSuccess = false;

        try {
            preparedStatement = connection.prepareStatement("select * from user_auth where username = ?");
            preparedStatement.setString(1, username);
            resultSet = preparedStatement.executeQuery();
            while (resultSet.next()) {
                dbPassword = resultSet.getString("password");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }

        if (passwordService.passwordsMatch(password, dbPassword)) {
            loginSuccess = true;
        } 
        return loginSuccess;
    }