}
}
- public int executeUpdate() {
+ public void executeUpdate() {
try {
- return target.executeUpdate();
+ int updated = target.executeUpdate();
+ if (updated != 1) {
+ throw new Error("FATAL: multiple or no data updated: " + updated);
+ }
} catch (SQLException e) {
handleSQL(e);
throw new Error(e);
ps = DatabaseConnection.getInstance().prepare("UPDATE users SET `password`=? WHERE id=?");
ps.setString(1, PasswordHash.hash(newPass));
ps.setInt(2, getId());
- if (ps.executeUpdate() != 1) {
- throw new GigiApiException("Password update failed.");
- }
+ ps.executeUpdate();
}
public void setName(Name name) {