pstmt = con.prepareStatement(LOAD_FORUM_BY_ID);
pstmt.setInt(1, id);
}
ResultSet rs = pstmt.executeQuery();
if (!rs.next()) {
throw new ForumNotFoundException("Forum " + getID() + " could not be loaded from the database.");
}
id = rs.getInt("forumID");
name = rs.getString("name");
description = rs.getString("description");
this.creationDate = new java.util.Date(Long.parseLong(rs.getString("creationDate").trim()));
this.modifiedDate = new java.util.Date(Long.parseLong(rs.getString("modifiedDate").trim()));
moderation = rs.getInt("moderated");
} catch (SQLException sqle) {
log.error("",sqle);
throw new ForumNotFoundException("Forum " + getID() + " could not be loaded from the database.");
} catch (NumberFormatException nfe) {
log.error(
"WARNING: In DbForum.loadFromDb() -- there "
+ "was an error parsing the dates returned from the database. Ensure "
+ "that they're being stored correctly.");