X
xhli
Unregistered / Unconfirmed
GUEST, unregistred user!
<%
String sTypeId = null;
String sTypeName = null;
ResultSet rs;
DbConn myDbConn = new DbConn();
rs = myDbConn.execQuery("select typeid, typename from typeinfo where typeid = '0'");
/* 我把sql语句单独提出来执行有记录的 */
%><select id=select1 name="TypeId" style="WIDTH: 145px">
<option value=A default>全部内容</option>
/* 我把下面的代码去掉就不报错啦!*/
<%
while(rs.next()){
sTypeId = rs.getString("typeid");
sTypeName = rs.getString("typename");
out.print("<option value=" + sTypeId + ">");
out.print(sTypeName);
out.print("</option>");
}
rs.close();
%>
报错操作啦无效数据
java.lang.NullPointerException
是哪里的问题啊?
String sTypeId = null;
String sTypeName = null;
ResultSet rs;
DbConn myDbConn = new DbConn();
rs = myDbConn.execQuery("select typeid, typename from typeinfo where typeid = '0'");
/* 我把sql语句单独提出来执行有记录的 */
%><select id=select1 name="TypeId" style="WIDTH: 145px">
<option value=A default>全部内容</option>
/* 我把下面的代码去掉就不报错啦!*/
<%
while(rs.next()){
sTypeId = rs.getString("typeid");
sTypeName = rs.getString("typename");
out.print("<option value=" + sTypeId + ">");
out.print(sTypeName);
out.print("</option>");
}
rs.close();
%>
报错操作啦无效数据
java.lang.NullPointerException
是哪里的问题啊?