public boolean setPassword(UUID userId, String oldPassword, String newPassword, String newPasswordConfirm) throws Exception {
        boolean ret = false;

        if (newPassword.equals(newPasswordConfirm)) {
            User userObj = getById(userId);

            if (userObj != null) {
                String userPw = userObj.getPassword().toLowerCase();
                String oldPw = Functions.getMd5Hash(oldPassword).toLowerCase();

                if (userPw.equals(oldPw)) {
                    Connection conn = null;
                    CallableStatement stmt = null;

                    try {
                        conn = getConnection();

                        String query = "{call spr_setPassword( ?, ?, ? )} ";

                        // Get a statement from the connection
                        stmt = conn.prepareCall(query);

                        int i = 1;
                        stmt.setString(i++, userObj.getEmail());
                        stmt.setString(i++, newPassword);
                        stmt.registerOutParameter(i, Types.BOOLEAN);

                        // Execute the query
                        stmt.execute();

                        ret = stmt.getBoolean("ret");
                    } catch (SQLException ex) {
                        LOGGER.error(ex.getMessage());

                        throw new SQLException(ex);
                    } finally {
                        if (stmt != null) {
                            stmt.close();
                        }

                        if (conn != null) {
                            conn.close();
                        }
                    }
                }
                else {
                    throw new Exception("Das aktuelle Passwort stimmt nicht.");
                }
            }
            else {
                throw new Exception("Benutzer wurde nicht gefunden.");
            }
        }
        else {
            throw new Exception("Die Passwörter sind nicht identisch");
        }

        return ret;
    }