Package org.nemesis.forum.exception

Examples of org.nemesis.forum.exception.ForumThreadNotFoundException


      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(LOAD_THREAD);
      pstmt.setInt(1, id);
      ResultSet rs = pstmt.executeQuery();
      if (!rs.next()) {
        throw new ForumThreadNotFoundException("Thread " + id + " could not be loaded from the database.");
      }
      //try {
      rootMessageID = rs.getInt("rootMessageID");
      //}
      //catch (ForumMessageNotFoundException fmnfe) {
      //    log("Error: could not load root message of thread "
      //        + id + ". The database record could be corrupt.");
      //   
      //}
      creationDate = new java.util.Date(Long.parseLong(rs.getString("creationDate").trim()));
      modifiedDate = new java.util.Date(Long.parseLong(rs.getString("modifiedDate").trim()));
      approved = rs.getInt("approved")==1;
      pstmt.close();
    } catch (SQLException sqle) {
      log.error("load",sqle);
      throw new ForumThreadNotFoundException("Thread " + id + " could not be loaded from the database.");
    } catch (NumberFormatException nfe) {
      log.error(
        "WARNING: In DbForumThread.loadFromDb() -- there "
          + "was an error parsing the dates returned from the database. Ensure "
          + "that they're being stored correctly.");
View Full Code Here

TOP

Related Classes of org.nemesis.forum.exception.ForumThreadNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.