public static void update(IUser u) throws SQLException, LostUpdateException { int count = UserTDG.update(u.getId(), u.getVersion(), u.getUsername(), u.getPassword()); if (count == 0) throw new LostUpdateException("Lost Update editing user with id " + u.getId()); u.setVersion(u.getVersion() + 1); }