while嵌套查询问题 急!!
<%ResultSet maxfl=conn.mySelect("select * from maxclass ");while (maxfl.next()){
%>
<tr>
<td width="29%" height="20"><strong><%=maxid%><%=maxfl.getString("classname")%></strong></td>
</tr>
<%
ResultSet minfl=conn.mySelect(" select * from minclass where belong="+maxfl.getInt("id")+"");
while (minfl.next()){
%>
<tr>
<td width="40%" height="20" align="left"><a href="class.asp?id=<%=minfl.getInt("id")%>"><%=minfl.getString("minname")%></a></td>
</tr>
<%
}
}
%>我的意思是每显示一个大分类就把属于该大分类的所有小分类输出来.
出现下列错误:
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException
com.microsoft.jdbc.base.BaseResultSet.cancelPendingUpdates(Unknown Source)
com.microsoft.jdbc.base.BaseResultSet.next(Unknown Source)
org.apache.jsp.fl_jsp._jspService(fl_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
[此贴子已经被作者于2007-5-25 19:00:33编辑过]