你不是这样写jsp吧?
不想看了

解决方案 »

  1.   

    我觉得rs.getString("theme")不能调用两次吧
    你先用一个变量赋值
      

  2.   

    <td><a href="FriendContent.jsp?theme=<%=rs.getString("theme")%><%=rs.getString("theme")%></a></td></tr>:
    <td><a href='FriendContent.jsp?theme=<%=rs.getString("theme")%>'><%=rs.getString("theme")%></a></td></tr>
      

  3.   

    不过还是建议你写成:
    <%
    String strTheme=rs.getString("theme");
    %>
    <td><a href="FriendContent.jsp?theme=<%=strTheme%>"><%=strTheme%></a></td></tr>
      

  4.   

    是这样的,你生成的statement不是滚轴敏感的,好像是这样说得。
    所以你的rs get一次之后就不能再取了。你应该用中间变量把rs中的值取出来,然后再用到的时候,用中间变量去付值。你应该多用用中间变量。sql语句应该专门用一个字符串表示。乱死了简直。
      

  5.   

    createStatement
    public Statement createStatement(int resultSetType,
                                     int resultSetConcurrency,
                                     int resultSetHoldability)
                              throws SQLExceptionCreates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability. This method is the same as the createStatement method above, but it allows the default result set type, concurrency, and holdability to be overridden. Parameters:
    resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
    resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
    resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT 
    Returns:
    a new Statement object that will generate ResultSet objects with the given type, concurrency, and holdability 
    Throws: 
    SQLException - if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
    Since:
    1.4 
    See Also:
    ResultSet
      

  6.   

    你可以这样写:变量1=rs.getInt(1);  -->BBS.number
    变量2=rs.getString(2);  -->userInfor.uid
    变量3=rs.getDate(3);   -->BBS.date
    变量4=rs.getString(4);  -->BBS.theme 然后把那个get语句出现的地方替换成变量!你好好看看createStatement方法说明。
    另外,这些东西怎么也应该写个bean,否则真的很乱。
      

  7.   

    谢谢 各位的帮助,特别是
    sikuan(冰糖★葫芦★头) 
    carrysilence(jafler) 的热心帮助
    这个问题已经解决了。