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
你先用一个变量赋值
<td><a href='FriendContent.jsp?theme=<%=rs.getString("theme")%>'><%=rs.getString("theme")%></a></td></tr>
<%
String strTheme=rs.getString("theme");
%>
<td><a href="FriendContent.jsp?theme=<%=strTheme%>"><%=strTheme%></a></td></tr>
所以你的rs get一次之后就不能再取了。你应该用中间变量把rs中的值取出来,然后再用到的时候,用中间变量去付值。你应该多用用中间变量。sql语句应该专门用一个字符串表示。乱死了简直。
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
变量2=rs.getString(2); -->userInfor.uid
变量3=rs.getDate(3); -->BBS.date
变量4=rs.getString(4); -->BBS.theme 然后把那个get语句出现的地方替换成变量!你好好看看createStatement方法说明。
另外,这些东西怎么也应该写个bean,否则真的很乱。
sikuan(冰糖★葫芦★头)
carrysilence(jafler) 的热心帮助
这个问题已经解决了。