ps = conn.prepareStatement(ContestPersistenceImpl.DELETE_CONTEST);
ps.setLong(1, user);
ps.setTimestamp(2, new Timestamp(new Date().getTime()));
ps.setLong(3, id);
if (ps.executeUpdate() == 0) {
throw new PersistenceException("no such contest");
}
} finally {
Database.dispose(ps);
}
} catch (PersistenceException e) {
throw e;
} catch (SQLException e) {
throw new PersistenceException("Failed to delete contest.", e);
} finally {
Database.dispose(conn);
}
}