下面这段程序:
String data = "-";
while(rs.next()) {
%>
<tr>
<%
for(i=0;i<count;i++)
{
System.err.println(i);
if(i == 5)
{
float temp = rs.getFloat(i+1);
data = Float.toString(db.SellPrice(temp));
}
else
{
data = rs.getString(i+1);
if(data==null)
data = "-";
}
System.err.println(data);
%>
<td><%=data%></td>
<%
}
}
下面出错提示,中间包含err.println的数出结果:
0
1000232
1
手术刀柄
2
3号-200MM
3
24
4
把
5
16.15
6
StandardWrapperValve[debugjsp]: Servlet.service() for servlet debugjsp threw exception
java.lang.NullPointerException
java.lang.NullPointerException
at oracle.jdbc.driver.ScrollableResultSet.getCachedDatumValueAt(ScrollableResultSet.java:1307)
at oracle.jdbc.driver.ScrollableResultSet.getOracleObject(ScrollableResultSet.java:398)
at oracle.jdbc.driver.ScrollableResultSet.getString(ScrollableResultSet.java:406)
at org.apache.jsp.main$jsp._jspService(main$jsp.java:167)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)