+ return true;
+ }
+
+ public synchronized static boolean assure(User assurer, User target,
+ int awarded, String location, String date) throws SQLException {
+ if (!checkAssuranceIsPossible(assurer, target, null)) {
+ return false;
+ }
+ User u = new User(target.getId());
+ if (!u.equals(target)) {
+ return false;
+ }
+ System.out.println("Would now assure.");
+ if (awarded > assurer.getMaxAssurePoints()) {
+ return false;
+ }
+
+ PreparedStatement ps = DatabaseConnection
+ .getInstance()
+ .prepare(
+ "INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?");
+ ps.setInt(1, assurer.getId());
+ ps.setInt(2, target.getId());
+ ps.setInt(3, awarded);
+ ps.setString(4, location);
+ ps.setString(5, date);
+ ps.execute();
+ return true;