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

如何使用两个这样的结果集,高手指教!!!
<%@   page   contentType= "text/html;   charset=gb2312 "   language= "java "   import= "java.sql.* "   errorPage= " "   %>
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<title> 显示主题 </title>
</head>
<body   onLoad= "clockon(bgclock); ">
<jsp:useBean   id= "connection "   scope= "request "   class= "com.JDBConnection "/>
<table   width= "777 "   height= "33 "   border= "0 "   align= "center "   cellpadding= "0 "   cellspacing= "0 "   background= "image/navigation3.jpg ">
    <tr>
        <td> &nbsp;&nbsp;&nbsp;&nbsp; <font   color= "#FFFFFF "> ≡   JSP   专区   ≡   </font> </td>
    </tr>
</table>
<table   width= "777 "   border= "1 "   align= "center "   cellpadding= "0 "   cellspacing= "0 "   bordercolor= "#FFFFFF "   bordercolordark= "#9EA5D1 "   bordercolorlight= "#FFFFFF "   >
    <tr   align= "center ">
        <td   width= "47 "   height= "25 "   background= "image/bg_Navigate.GIF "> 状态 </td>
        <td   width= "351 "   background= "image/bg_Navigate.GIF "> 主题 </td>
        <td   width= "140 "   background= "image/bg_Navigate.GIF "> 发布人 </td>
        <td   width= "78 "   background= "image/bg_Navigate.GIF "> 回复数量 </td>
        <td   width= "149 "   background= "image/bg_Navigate.GIF "> 发布时间 </td>
    </tr>
<%
String   sqlTitle= "select   *   from   tb_forumSend   order   by   id   desc ";
ResultSet   rsTitle=connection.executeQuery(sqlTitle);
String   number= " ";
String   id= " ";
try{
while(rsTitle.next()){
id=rsTitle.getString( "id ");
//String   sqlBack= "select   count(*)   as   number   from   tb_forumBack   where   id= ' "+id+ " ' ";

//ResultSet   rsBack=connection.executeQuery(sqlBack);
//while(rsBack.next()){
//number=rsBack.getString( "number ");
//}
%>
    <tr   align= "center ">
        <td   height= "30 "> <img   src= "image/reader.gif "> </td>
        <td   align= "left "> &nbsp; <a   href= "showContent.jsp?id= <%=id%> "> <%=rsTitle.getString( "title ")%> </a> </td>
        <td> <%=rsTitle.getString( "account ")%> </td>

        <td> <%//=number%> </td>