+
+ public void updateUserData() throws SQLException, GigiApiException {
+ synchronized (Notary.class) {
+ if (getAssurancePoints() != 0) {
+ updateUserData();
+ throw new GigiApiException("No change after assurance allowed.");
+ }
+ PreparedStatement update = DatabaseConnection.getInstance().prepare("UPDATE users SET fname=?, lname=?, mname=?, suffix=?, dob=? WHERE id=?");
+ update.setString(1, getFname());
+ update.setString(2, getLname());
+ update.setString(3, getMname());
+ update.setString(4, getSuffix());
+ update.setDate(5, getDob());
+ update.setInt(6, getId());
+ update.executeUpdate();
+ }
+ }
+
+ public Locale getPreferredLocale() {
+ return locale;
+ }
+
+ public void setPreferredLocale(Locale locale) {
+ this.locale = locale;
+
+ }
+
+ public boolean wantsDirectoryListing() throws SQLException {
+ PreparedStatement get = DatabaseConnection.getInstance().prepare("SELECT listme FROM users WHERE id=?");
+ get.setInt(1, getId());
+ ResultSet exec = get.executeQuery();
+ exec.next();
+ return exec.getBoolean("listme");
+ }
+
+ public String getContactInformation() throws SQLException {
+ PreparedStatement get = DatabaseConnection.getInstance().prepare("SELECT contactinfo FROM users WHERE id=?");
+ get.setInt(1, getId());
+ ResultSet exec = get.executeQuery();
+ exec.next();
+ return exec.getString("contactinfo");
+ }
+
+ public void setDirectoryListing(boolean on) throws SQLException {
+ PreparedStatement update = DatabaseConnection.getInstance().prepare("UPDATE users SET listme = ? WHERE id = ?");
+ update.setBoolean(1, on);
+ update.setInt(2, getId());
+ update.executeUpdate();
+ }
+
+ public void setContactInformation(String contactInfo) throws SQLException {
+ PreparedStatement update = DatabaseConnection.getInstance().prepare("UPDATE users SET contactinfo = ? WHERE id = ?");
+ update.setString(1, contactInfo);
+ update.setInt(2, getId());
+ update.executeUpdate();
+ }
+