[Rapforums-developer] src/source/edu/fullcoll/uportal/channels/rap/forum/xml MSViewXML.java,1.1,1.2
Status: Beta
Brought to you by:
brippe
From: Brad R. <br...@us...> - 2005-02-04 00:57:58
|
Update of /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17763 Modified Files: MSViewXML.java MySQLViewXML.java OracleViewXML.java RAPViewXML.java RAPXML.java Log Message: no message Index: RAPXML.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/xml/RAPXML.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPXML.java 26 Jan 2004 19:02:08 -0000 1.3 --- RAPXML.java 4 Feb 2005 00:57:37 -0000 1.4 *************** *** 46,50 **** * * @author Brad Rippe (br...@fu...) ! * @version 0.8.3 $Revision %G% * @deprecated */ --- 46,50 ---- * * @author Brad Rippe (br...@fu...) ! * @version 0.9.0 $Revision %G% * @deprecated */ Index: MySQLViewXML.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/xml/MySQLViewXML.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MySQLViewXML.java 26 Jan 2004 19:01:55 -0000 1.1 --- MySQLViewXML.java 4 Feb 2005 00:57:37 -0000 1.2 *************** *** 22,25 **** --- 22,26 ---- import java.sql.*; + import javax.sql.*; import java.util.List; *************** *** 85,91 **** --- 86,132 ---- + "threadid, (select count(commentid) from rapcomment where threadid = ?) as numcomments " + "from rapthread where forumid = ? and threadid = ?"; + + private final static String SELECT_FORUM_NAMES + = "select forumid, name from rapforum order by name"; private SimpleDateFormat df = new SimpleDateFormat("EEEE, MMMM d, yyyy 'at' HH:mm aaa"); + + /** + * Returns the xml for displaying forums names and ids. + * @return xml document + * @see org.jdom.Document + * @see edu.fullcoll.uportal.channels.rap.forum.commands.AdminModeCommand + */ + public Document getForumNameXML() throws RAPDBException { + + PreparedStatement stmt = null; + ResultSet rs = null; + Connection dbConnection = null; + + try { + + dbConnection = getDBConnection(); + stmt = dbConnection.prepareStatement(SELECT_FORUM_NAMES, + ResultSet.TYPE_SCROLL_INSENSITIVE, + ResultSet.CONCUR_READ_ONLY); + + rs = stmt.executeQuery(); + ResultSetBuilder builder = new ResultSetBuilder(rs, VIEW_FORUMS_ROOT_NAME, VIEW_FORUMS_RECORD_NAME); + //forumNameXML = builder.build(); + return builder.build(); + + } catch(Exception e) { + LogService.instance().log(LogService.ERROR, "DB ERROR: " + e); + e.printStackTrace(); + + throw new RAPDBException("Unknown Error Occured", e); + } finally { + closeStatement(stmt); + closeResultSet(rs); + closeConnection(dbConnection); + } + } + /** * Returns the xml for displaying forums. This xml is associated with forums.xsl and transforumed. *************** *** 96,100 **** * @see edu.fullcoll.uportal.channels.rap.forum.commands.ForumModeCommand */ ! public Document getForumsXML(int startRow, int endRow) throws RAPDBException { PreparedStatement stmt = null; ResultSet rs = null; --- 137,141 ---- * @see edu.fullcoll.uportal.channels.rap.forum.commands.ForumModeCommand */ ! public Document getForumsXML(int startRow, int endRow, String user) throws RAPDBException { PreparedStatement stmt = null; ResultSet rs = null; *************** *** 225,229 **** } } ! /** * Returns the xml for displaying threads. This xml is associated with threads.xsl and transforumed. --- 266,270 ---- } } ! /** * Returns the xml for displaying threads. This xml is associated with threads.xsl and transforumed. Index: OracleViewXML.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/xml/OracleViewXML.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OracleViewXML.java 26 Jan 2004 19:01:55 -0000 1.1 --- OracleViewXML.java 4 Feb 2005 00:57:37 -0000 1.2 *************** *** 22,26 **** --- 22,29 ---- import java.sql.*; + import javax.sql.*; + + import java.util.GregorianCalendar; import java.util.List; import java.util.Iterator; *************** *** 50,54 **** * * @author Brad Rippe (br...@fu...) and Steve Barrett (sm...@co...) ! * @version 0.8.3 $Revision %G% * @see org.jdom.Document */ --- 53,57 ---- * * @author Brad Rippe (br...@fu...) and Steve Barrett (sm...@co...) ! * @version 0.9.0 $Revision %G% * @see org.jdom.Document */ *************** *** 72,76 **** --- 75,118 ---- + "threadid, (select count(commentid) from rapcomment where threadid = ?) as numcomments " + "from rapthread where forumid = ? and threadid = ?"; + + private final static String SELECT_FORUM_NAMES + = "select forumid, name from rapforum order by name"; + + /** + * Returns the xml for displaying forums names and ids. + * @return xml document + * @see org.jdom.Document + * @see edu.fullcoll.uportal.channels.rap.forum.commands.AdminModeCommand + */ + public Document getForumNameXML() throws RAPDBException { + + PreparedStatement stmt = null; + ResultSet rs = null; + Connection dbConnection = null; + + try { + + dbConnection = getDBConnection(); + stmt = dbConnection.prepareStatement(SELECT_FORUM_NAMES, + ResultSet.TYPE_SCROLL_INSENSITIVE, + ResultSet.CONCUR_READ_ONLY); + + rs = stmt.executeQuery(); + ResultSetBuilder builder = new ResultSetBuilder(rs, VIEW_FORUMS_ROOT_NAME, VIEW_FORUMS_RECORD_NAME); + return builder.build(); + + } catch(Exception e) { + LogService.instance().log(LogService.ERROR, "DB ERROR: " + e); + e.printStackTrace(); + + throw new RAPDBException("Unknown Error Occured", e); + } finally { + closeStatement(stmt); + closeResultSet(rs); + closeConnection(dbConnection); + } + } + /** * Returns the xml for displaying forums. This xml is associated with *************** *** 82,86 **** * @see edu.fullcoll.uportal.channels.rap.forum.commands.ForumModeCommand */ ! public Document getForumsXML(int startRow, int endRow) throws RAPDBException { PreparedStatement stmt = null; ResultSet rs = null; --- 124,128 ---- * @see edu.fullcoll.uportal.channels.rap.forum.commands.ForumModeCommand */ ! public Document getForumsXML(int startRow, int endRow, String user) throws RAPDBException { PreparedStatement stmt = null; ResultSet rs = null; *************** *** 90,115 **** dbConnection = getDBConnection(); StringBuffer sql = new StringBuffer(""); ! sql.append( "select * from ( select a.*, rownum rnum from ( select rapforum.forumid, rapforum.name, rapforum.description, rapcategory.name as categoryname," ); ! sql.append( " (select count(threadid) from rapthread where rapthread.forumid = rapforum.forumid) as numthreads," ); ! sql.append( " (select count(commentid) from rapcomment where rapcomment.forumid = rapforum.forumid) as numcomments," ); ! sql.append( " (select max(commentid) from rapcomment where rapcomment.forumid = rapforum.forumid) as lastcommentid," ); ! sql.append( " (select modifieddate from rapcomment where commentid =" ); ! sql.append( " (select max(commentid) from rapcomment rapcomment where rapcomment.forumid = rapforum.forumid)) as lastdate," ); ! sql.append( " (select userid from rapcomment where commentid =" ); ! sql.append( " (select max(commentid) as commentid from rapcomment rapcomment where rapcomment.forumid = rapForum.forumid)) as lastauthor" ); ! sql.append( " from rapforum inner join rapcategory on rapforum.categoryid = rapcategory.categoryid" ); ! sql.append( " order by rapcategory.categoryid) a where rownum <= ? ) where rnum >= ?" ); ! stmt = dbConnection.prepareStatement(sql.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY ); ! stmt.setInt(1, startRow); ! stmt.setInt(2, endRow); rs = stmt.executeQuery(); ResultSetBuilder builder = new ResultSetBuilder(rs, "rapforums", "rapforum"); - return builder.build(); --- 132,160 ---- dbConnection = getDBConnection(); + // NullPointerException can be cause be select * from the oracle drivers StringBuffer sql = new StringBuffer(""); ! sql.append("select rownum, forumid, name, description, categoryname, numthreads, numcomments, lastcommentid, lastdate, lastauthor "); ! sql.append("from (select a.forumid, a.name, a.description, a.categoryname, a.numthreads, a.numcomments, a.lastcommentid, a.lastdate, a.lastauthor, rownum "); ! sql.append("from ( select rapforum.forumid, rapforum.name, rapforum.description, rapcategory.name as categoryname, "); ! sql.append("(select count(threadid) from rapthread where rapthread.forumid = rapforum.forumid) as numthreads, "); ! sql.append("(select count(commentid) from rapcomment where rapcomment.forumid = rapforum.forumid) as numcomments, "); ! sql.append("(select max(commentid) from rapcomment where rapcomment.forumid = rapforum.forumid) as lastcommentid, "); ! sql.append("(select modifieddate from rapcomment where commentid = "); ! sql.append("(select max(commentid) from rapcomment, rapforum where rapcomment.forumid = rapforum.forumid)) as lastdate, "); ! sql.append("(select userid from rapcomment where commentid ="); ! sql.append("(select max(commentid) as commentid from rapcomment rapcomment where rapcomment.forumid = rapforum.forumid)) as lastauthor "); ! sql.append("from rapforum inner join rapcategory on rapforum.categoryid = rapcategory.categoryid "); ! sql.append("order by rapcategory.categoryid) a where rownum <= ?)"); //end row ! sql.append("where rownum >= ?"); // start row ! stmt = dbConnection.prepareStatement(sql.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY ); ! stmt.setInt(1, endRow); ! stmt.setInt(2, startRow); rs = stmt.executeQuery(); ResultSetBuilder builder = new ResultSetBuilder(rs, "rapforums", "rapforum"); return builder.build(); *************** *** 117,121 **** LogService.instance().log(LogService.ERROR, "DB ERROR: " + e); e.printStackTrace(); ! throw new RAPDBException("Unkown Error Occured", e); } finally { closeStatement(stmt); --- 162,166 ---- LogService.instance().log(LogService.ERROR, "DB ERROR: " + e); e.printStackTrace(); ! throw new RAPDBException("Unknown Error Occured", e); } finally { closeStatement(stmt); *************** *** 154,166 **** Element forumElement = doc.getRootElement().getChild("rapforum"); ! StringBuffer sql = new StringBuffer("select * from ( select a.*, rownum rnum from" ); ! sql.append( " (select threadid, rootcommentid, " ); ! sql.append( " (select subject from rapcomment where commentid=rootcommentid) as commentsubject, " ); ! sql.append( " (select userid from rapcomment where commentid=rootcommentid) as threadauthor, " ); ! sql.append( " (select count(threadid) from rapcomment where rapcomment.threadid=rapthread.threadid) as numcomments, " ); ! sql.append( " (select modifieddate from " ); ! sql.append( " (select rapcomment.modifieddate from rapcomment, rapthread where rapcomment.threadid=rapthread.threadid order by rapcomment.modifieddate desc)" ); ! sql.append( " where ROWNUM=1) AS lastcommentdate " ); ! sql.append( " from rapthread where forumid = ? order by threadid asc) a where rownum <= ?) where rnum >= ?" ); stmt = dbConnection.prepareStatement(sql.toString(), --- 199,212 ---- Element forumElement = doc.getRootElement().getChild("rapforum"); ! StringBuffer sql = new StringBuffer("select rownum, threadid, rootcommentid, commentsubject, threadauthor, numcomments, lastcommentdate from "); ! sql.append( "( select rownum, a.threadid, a.rootcommentid, a.commentsubject, a.threadauthor, a.numcomments, a.lastcommentdate from "); ! sql.append( "(select threadid, rootcommentid, "); ! sql.append( "(select subject from rapcomment where commentid=rootcommentid) as commentsubject, "); ! sql.append( "(select userid from rapcomment where commentid=rootcommentid) as threadauthor, "); ! sql.append( "(select count(threadid) from rapcomment where rapcomment.threadid=rapthread.threadid) as numcomments, "); ! sql.append( "(select modifieddate from "); ! sql.append( "(select rapcomment.modifieddate from rapcomment, rapthread where rapcomment.threadid=rapthread.threadid order by rapcomment.modifieddate desc) "); ! sql.append( "where ROWNUM=1) AS lastcommentdate "); ! sql.append( "from rapthread where forumid = ? order by threadid asc) a where rownum <= ?) where rownum >= ?"); stmt = dbConnection.prepareStatement(sql.toString(), *************** *** 168,173 **** ResultSet.CONCUR_READ_ONLY); stmt.setInt(1, forumID); ! stmt.setInt(2, startRow); ! stmt.setInt(3, endRow); rs = stmt.executeQuery(); --- 214,219 ---- ResultSet.CONCUR_READ_ONLY); stmt.setInt(1, forumID); ! stmt.setInt(2, endRow); ! stmt.setInt(3, startRow); rs = stmt.executeQuery(); *************** *** 224,237 **** Element forumElement = doc.getRootElement().getChild("rapforum"); ! StringBuffer sql = new StringBuffer("select * from ( select a.*, rownum rnum from "); ! sql.append( "(select commentid, parentcommentid, threadid, forumid, userid, subject, body, modvalue, bonuspoints, creationdate, modifieddate" ); ! sql.append( " from rapcomment where threadid = ? order by commentid asc) a where rownum <= ? ) where rnum >= ?" ); ! stmt = dbConnection.prepareStatement(sql.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); stmt.setInt(1, threadID); ! stmt.setInt(2, startRow); ! stmt.setInt(3, endRow); rs = stmt.executeQuery(); --- 270,284 ---- Element forumElement = doc.getRootElement().getChild("rapforum"); ! StringBuffer sql = new StringBuffer("select rownum, commentid, parentcommentid, threadid, forumid, userid, subject, body, modvalue, bonuspoints, creationdate, modifieddate "); ! sql.append( "from ( select a.commentid, a.parentcommentid, a.threadid, a.forumid, a.userid, a.subject, a.body, a.modvalue, a.bonuspoints, a.creationdate, a.modifieddate, rownum rnum from "); ! sql.append( "(select commentid, parentcommentid, threadid, forumid, userid, subject, body, modvalue, bonuspoints, creationdate, modifieddate "); ! sql.append( "from rapcomment where threadid = ? order by commentid asc) a where rownum <= ? ) where rnum >= ?"); ! stmt = dbConnection.prepareStatement(sql.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); stmt.setInt(1, threadID); ! stmt.setInt(2, endRow); ! stmt.setInt(3, startRow); rs = stmt.executeQuery(); *************** *** 309,313 **** int count, int lastForumID, int lastThreadID, int lastCommentID) throws RAPDBException { ! StringBuffer SELECT_VIEW_SEARCH = new StringBuffer("select rapcomment.subject as title, rapcomment.creationdate as posteddate,"); SELECT_VIEW_SEARCH.append("rapcomment.userid as username, rapcomment.body as description, "); SELECT_VIEW_SEARCH.append("threadid, forumid, commentid from rapcomment "); --- 356,360 ---- int count, int lastForumID, int lastThreadID, int lastCommentID) throws RAPDBException { ! StringBuffer SELECT_VIEW_SEARCH = new StringBuffer("select rapcomment.subject as title, rapcomment.creationdate as posteddate, "); SELECT_VIEW_SEARCH.append("rapcomment.userid as username, rapcomment.body as description, "); SELECT_VIEW_SEARCH.append("threadid, forumid, commentid from rapcomment "); Index: MSViewXML.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/xml/MSViewXML.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MSViewXML.java 26 Jan 2004 19:01:55 -0000 1.1 --- MSViewXML.java 4 Feb 2005 00:57:37 -0000 1.2 *************** *** 24,28 **** import java.sql.*; ! import javax.sql.*; import java.util.List; import java.util.Iterator; --- 24,28 ---- import java.sql.*; ! import java.util.GregorianCalendar; import java.util.List; import java.util.Iterator; *************** *** 31,40 **** import org.jdom.*; - import org.jdom.output.*; import org.jdom.contrib.input.ResultSetBuilder; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDBService; import edu.fullcoll.uportal.channels.rap.forum.database.RAPDBException; - import edu.fullcoll.uportal.channels.rap.forum.database.DatabaseNames; /** --- 31,38 ---- *************** *** 51,55 **** * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.8.3 $Revision %G% * @see org.jdom.Document */ --- 49,53 ---- * * @author Brad Rippe (br...@fu...), Chris Pereda (cp...@fu...) ! * @version 0.9.0 $Revision %G% * @see org.jdom.Document */ *************** *** 66,69 **** --- 64,70 ---- + "(select count(forumid) from rapthread where forumid = ?) as numthreads " + "from rapforum where forumid = ?"; + + private final static String SELECT_FORUM_NAMES + = "select forumid, name from rapforum order by name"; private final static String SELECT_THREAD_HELPER *************** *** 74,105 **** + " as forumcategoryname, threadid, (select count(commentid) from rapcomment where threadid = ?) as numcomments " + "from rapthread where forumid = ? and threadid = ?"; ! /** * Returns the xml for displaying forums. This xml is associated with * forums.xsl and transforumed. * @param startRow the first row to return ! * @param endRow the the last row to return * @return xml document * @see org.jdom.Document * @see edu.fullcoll.uportal.channels.rap.forum.commands.ForumModeCommand */ ! public Document getForumsXML(int startRow, int endRow) throws RAPDBException { ! PreparedStatement stmt = null; ResultSet rs = null; Connection dbConnection = null; try { dbConnection = getDBConnection(); ! // Code modified 5/1/03 - by Brad Rippe ! // Utilitize stored procedures for paging via SQL Server ! // Added scrollable result sets ! stmt = dbConnection.prepareStatement("{call sp_getSelectViewForums(?, ?)}", ! ResultSet.TYPE_SCROLL_INSENSITIVE, ! ResultSet.CONCUR_READ_ONLY); ! stmt.setInt(1, startRow); ! stmt.setInt(2, endRow); rs = stmt.executeQuery(); ! ResultSetBuilder builder = new ResultSetBuilder(rs, "rapforums", "rapforum"); return builder.build(); --- 75,152 ---- + " as forumcategoryname, threadid, (select count(commentid) from rapcomment where threadid = ?) as numcomments " + "from rapthread where forumid = ? and threadid = ?"; ! ! /** * Returns the xml for displaying forums. This xml is associated with * forums.xsl and transforumed. * @param startRow the first row to return ! * @param endRow the last row to return ! * @param user the name of user - null to return all forums * @return xml document * @see org.jdom.Document * @see edu.fullcoll.uportal.channels.rap.forum.commands.ForumModeCommand */ ! public Document getForumsXML(int startRow, int endRow, String user) throws RAPDBException { ! ! CallableStatement stmt = null; ! ResultSet rs = null; ! Connection dbConnection = null; ! ! try { ! dbConnection = getDBConnection(); ! if(user != null) { ! stmt = dbConnection.prepareCall("{call sp_getSelectViewForums(?, ?, ?)}", ! ResultSet.TYPE_SCROLL_INSENSITIVE, ! ResultSet.CONCUR_READ_ONLY); ! stmt.setInt(1, startRow); ! stmt.setInt(2, endRow); ! stmt.setString(3, user); ! } else { ! stmt = dbConnection.prepareCall("{call sp_getSelectAllViewForums(?, ?)}", ! ResultSet.TYPE_SCROLL_INSENSITIVE, ! ResultSet.CONCUR_READ_ONLY); ! stmt.setInt(1, startRow); ! stmt.setInt(2, endRow); ! } ! ! rs = stmt.executeQuery(); ! ! ResultSetBuilder builder = new ResultSetBuilder(rs, VIEW_FORUMS_ROOT_NAME, VIEW_FORUMS_RECORD_NAME); ! return builder.build(); ! ! } catch(Exception e) { ! LogService.instance().log(LogService.ERROR, "DB ERROR: " + e); ! e.printStackTrace(); ! ! throw new RAPDBException("Unknown Error Occured", e); ! } finally { ! closeStatement(stmt); ! closeResultSet(rs); ! closeConnection(dbConnection); ! } ! } ! ! /** ! * Returns the xml for displaying forums names and ids. ! * @return xml document ! * @see org.jdom.Document ! * @see edu.fullcoll.uportal.channels.rap.forum.commands.AdminModeCommand ! */ ! public Document getForumNameXML() throws RAPDBException { ! ! PreparedStatement stmt = null; ResultSet rs = null; Connection dbConnection = null; try { + dbConnection = getDBConnection(); ! stmt = dbConnection.prepareStatement(SELECT_FORUM_NAMES, ! ResultSet.TYPE_SCROLL_INSENSITIVE, ! ResultSet.CONCUR_READ_ONLY); rs = stmt.executeQuery(); ! ResultSetBuilder builder = new ResultSetBuilder(rs, VIEW_FORUMS_ROOT_NAME, VIEW_FORUMS_RECORD_NAME); ! //forumNameXML = builder.build(); return builder.build(); *************** *** 108,112 **** e.printStackTrace(); ! throw new RAPDBException("Unkown Error Occured", e); } finally { closeStatement(stmt); --- 155,159 ---- e.printStackTrace(); ! throw new RAPDBException("Unknown Error Occured", e); } finally { closeStatement(stmt); *************** *** 127,140 **** */ public Document getThreadsXML(int forumID, int startRow, int endRow) throws RAPDBException { ! PreparedStatement stmt = null; ResultSet rs = null; Connection dbConnection = null; try { - dbConnection = getDBConnection(); // code modified 5/1/03 - by Brad Rippe // added scrollable result set ! stmt = dbConnection.prepareStatement(SELECT_FORUM_HELPER, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); --- 174,186 ---- */ public Document getThreadsXML(int forumID, int startRow, int endRow) throws RAPDBException { ! PreparedStatement stmt = null; ResultSet rs = null; Connection dbConnection = null; try { dbConnection = getDBConnection(); // code modified 5/1/03 - by Brad Rippe // added scrollable result set ! stmt = dbConnection.prepareStatement(SELECT_FORUM_HELPER, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); *************** *** 150,154 **** // Utilitize stored procedures for paging via SQL Server // Added scrollable result sets ! stmt = dbConnection.prepareStatement("{call sp_getSelectViewThreads(?, ?, ?)}", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); --- 196,200 ---- // Utilitize stored procedures for paging via SQL Server // Added scrollable result sets ! stmt = dbConnection.prepareCall("{call sp_getSelectViewThreads(?, ?, ?)}", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); *************** *** 157,161 **** stmt.setInt(3, endRow); ! rs = stmt.executeQuery(); builder = new ResultSetBuilder(rs, "rapthreads", "rapthread"); --- 203,207 ---- stmt.setInt(3, endRow); ! rs = stmt.executeQuery(); builder = new ResultSetBuilder(rs, "rapthreads", "rapthread"); *************** *** 168,172 **** e.printStackTrace(); ! throw new RAPDBException("Unkown Error Occured", e); } finally { closeStatement(stmt); --- 214,218 ---- e.printStackTrace(); ! throw new RAPDBException("Unknown Error Occured", e); } finally { closeStatement(stmt); *************** *** 212,216 **** // Code modified 1/3/03 - by Brad Rippe // Utilitize stored procedures for paging via SQL Server ! stmt = dbConnection.prepareStatement("{call sp_getSelectViewThread(?, ?, ?)}", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); --- 258,262 ---- // Code modified 1/3/03 - by Brad Rippe // Utilitize stored procedures for paging via SQL Server ! stmt = dbConnection.prepareCall("{call sp_getSelectViewThread(?, ?, ?)}", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); *************** *** 219,223 **** stmt.setInt(3, endRow); ! rs = stmt.executeQuery(); builder = new ResultSetBuilder(rs, "rapcomments", "rapcomment"); Element rapComments = builder.build().getRootElement().detach(); --- 265,270 ---- stmt.setInt(3, endRow); ! rs = stmt.executeQuery(); ! builder = new ResultSetBuilder(rs, "rapcomments", "rapcomment"); Element rapComments = builder.build().getRootElement().detach(); *************** *** 229,233 **** e.printStackTrace(); ! throw new RAPDBException("Unkown Error Occured", e); } finally { closeStatement(stmt); --- 276,280 ---- e.printStackTrace(); ! throw new RAPDBException("Unknown Error Occured", e); } finally { closeStatement(stmt); *************** *** 271,275 **** e.printStackTrace(); ! throw new RAPDBException("Unkown Error Occured", e); } finally { closeStatement(stmt); --- 318,322 ---- e.printStackTrace(); ! throw new RAPDBException("Unknown Error Occured", e); } finally { closeStatement(stmt); *************** *** 279,283 **** } - /** * Returns the xml for displaying search results. This xml is associated with --- 326,329 ---- *************** *** 457,461 **** e.printStackTrace(); ! throw new RAPDBException("Unkown Error Occured", e); } finally { closeStatement(stmt); --- 503,507 ---- e.printStackTrace(); ! throw new RAPDBException("Unknown Error Occured", e); } finally { closeStatement(stmt); *************** *** 474,478 **** */ public Document getCategoryXML() throws RAPDBException { ! PreparedStatement stmt = null; ResultSet rs = null; Connection dbConnection = null; --- 520,524 ---- */ public Document getCategoryXML() throws RAPDBException { ! PreparedStatement stmt = null; ResultSet rs = null; Connection dbConnection = null; *************** *** 480,490 **** try { dbConnection = getDBConnection(); ! stmt = dbConnection.prepareStatement(SELECT_VIEW_SEARCH_HELPER, ! ResultSet.TYPE_SCROLL_INSENSITIVE, ! ResultSet.CONCUR_READ_ONLY); ! rs = stmt.executeQuery(); ! ResultSetBuilder builder = new ResultSetBuilder(rs, "categories", "category"); ! return builder.build(); } catch(Exception e) { --- 526,536 ---- try { dbConnection = getDBConnection(); ! stmt = dbConnection.prepareStatement(SELECT_VIEW_SEARCH_HELPER, ! ResultSet.TYPE_SCROLL_INSENSITIVE, ! ResultSet.CONCUR_READ_ONLY); ! rs = stmt.executeQuery(); ! ResultSetBuilder builder = new ResultSetBuilder(rs, "categories", "category"); ! return builder.build(); } catch(Exception e) { *************** *** 492,496 **** e.printStackTrace(); ! throw new RAPDBException("Unkown Error Occured", e); } finally { closeStatement(stmt); --- 538,542 ---- e.printStackTrace(); ! throw new RAPDBException("Unknown Error Occured", e); } finally { closeStatement(stmt); *************** *** 540,544 **** e.printStackTrace(); ! throw new RAPDBException("Unkown Error Occured", e); } finally { closeStatement(stmt); --- 586,590 ---- e.printStackTrace(); ! throw new RAPDBException("Unknown Error Occured", e); } finally { closeStatement(stmt); Index: RAPViewXML.java =================================================================== RCS file: /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/xml/RAPViewXML.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RAPViewXML.java 26 Jan 2004 19:02:08 -0000 1.3 --- RAPViewXML.java 4 Feb 2005 00:57:37 -0000 1.4 *************** *** 33,37 **** * * @author Brad Rippe (br...@fu...) ! * @version 0.8.3 $Revision %G% */ public interface RAPViewXML { --- 33,37 ---- * * @author Brad Rippe (br...@fu...) ! * @version 0.9.0 $Revision %G% */ public interface RAPViewXML { *************** *** 46,50 **** * @see edu.fullcoll.uportal.channels.rap.forum.commands.ForumModeCommand */ ! public Document getForumsXML(int startRow, int endRow) throws RAPDBException; /** --- 46,58 ---- * @see edu.fullcoll.uportal.channels.rap.forum.commands.ForumModeCommand */ ! public Document getForumsXML(int startRow, int endRow, String user) throws RAPDBException; ! ! /** ! * Returns the xml for displaying forums names and ids. ! * @return xml document ! * @see org.jdom.Document ! * @see edu.fullcoll.uportal.channels.rap.forum.commands.AdminModeCommand ! */ ! public Document getForumNameXML() throws RAPDBException; /** |