日期:2014-05-18  浏览次数:20802 次

新闻类别读取出错,请各位兄弟帮看看错在哪儿,急!
下面就是我要用到的读取新闻类别类的一个方法:
/***************************************************************************
  *   函数名:ReadClass  
  *   作   用:读取所有类别   参   数:无  
  *   返回值:字符串
  **************************************************************************/
public   String   ReadClass()   {
try   {
Connection   Conn   =   DBConn.getConnection();
Statement   stmt   =   Conn.createStatement(1004,   1007);
Statement   stmt1   =   Conn.createStatement(1004,   1007);
String   sql   =   "select   *   from   BigClass   order   by   BigClassID ";
ResultSet   rs   =   stmt.executeQuery(sql);
StringBuffer   sb   =   new   StringBuffer();

sb
.append( " <br> <br> <table   width=\ "90%\ "     border=\ "1\ "   align=\ "center\ "   cellpadding=\ "2\ "   cellspacing=\ "0\ "> \r\n ");
sb
.append( " <tr> <td   height=\ "27\ "   colspan=\ "3\ "     background=\ "images/bg.gif\ "> ");
sb
.append( " <div   align=\ "center\ "   class=\ "title\ "> <strong> 新闻类别管理 </strong> </div> </td> ");
sb.append( " </tr> \r\n ");
sb.append( " <tr> \r\n ");
sb
.append( " <td   height=\ "25\ "   colspan=\ "4\ "> <strong> &nbsp; <a   href=\ "Admin_Class.jsp?Action=AddBigClass\ "> ");
sb
.append( " <font   color=\ "#ff6600\ "> [增加大类] </font> </a> </strong> </td> \r\n ");
sb.append( " </tr> \r\n ");
sb.append( " <tr> \r\n ");
sb
.append( " <td   height=\ "25\ "> <div   align=\ "center\ "   class=\ "chinese\ "> <b> 类别名称 </b> </div> </td> \r\n ");
sb
.append( " <td> <div   align=\ "center\ "   class=\ "chinese\ "> <b> 添加时间 </b> </div> </td> \r\n ");
sb
.append( " <td> <div   align=\ "center\ "   class=\ "chinese\ "> <b> 操作 </b> </div> </td> \r\n ");
sb.append( " </tr> \r\n ");

//   如果表中没有任何记录,刚给出提示信息
if   (!rs.next())   {
sb
.append( " <tr   height=\ "25\ "   bgcolor=\ "#d6dff7\ "     class=\ "info1\ "> <td   colspan=\ "3\ "> \r\n ");
sb
.append( " <div   align=\ "center\ "> <b> 暂时没有任何大类! </b> </div> </td> </tr> \r\n ");
}   else   {
while   (!rs.isAfterLast())   {
int   BigClassID   =   rs.getInt( "BigClassID ");
String   BigClassName   =   rs.getString( "BigClassName ");
String   BigClassInfo   =   rs.getString( "BigClassInfo ");
int[]   iBNum   =   ReadClassNews(BigClassID,   true,   false);
sb.append( " <tr   c