JSP页面内的多次查询(格式是没这么乱的贴上来就乱啦)要怎么改啊最好把代码贴上来ResultSetrs=sql.executeQuery("selectsum(CH_RES)as'LI_CH_RES',sum(QUEUED_CH_RES)as'LI_QUEUED_C...
JSP页面内的多次查询(格式是没这么乱的 贴上来就乱啦) 要怎么改啊 最好把代码贴上来
ResultSet rs=sql.executeQuery("select sum(CH_RES) as 'LI_CH_RES',sum(QUEUED_CH_RES) as 'LI_QUEUED_CH_RES',sum(TBSCallTime) as 'LI_TBSCallTime' from excel where TETRANetwork='13LI' ") ;
while(rs.next())
{
LI_CH_RES=rs.getInt("LI_CH_RES");
LI_QUEUED_CH_RES=rs.getInt("LI_QUEUED_CH_RES");
LI_TBSCallTime=rs.getInt("LI_TBSCallTime");
}
ResultSet rs1=sql.executeQuery("select sum(CH_RES) as 'LD_CH_RES',sum(QUEUED_CH_RES) as 'LD_QUEUED_CH_RES',sum(TBSCallTime) as 'LD_TBSCallTime' from excel where TETRANetwork='18LD'");
while(rs1.next())
{
LD_CH_RES=rs.getInt("LD_CH_RES");
LD_QUEUED_CH_RES=rs.getInt("LD_QUEUED_CH_RES");
LD_TBSCallTime=rs.getInt("LD_TBSCallTime");
}
ResultSet rs2=sql.executeQuery("select sum(CH_RES) as 'LIT_CH_RES',sum(QUEUED_CH_RES) as 'LIT_QUEUED_CH_RES',sum(TBSCallTime) as 'LIT_TBSCallTime' from excel where TETRANetwork='6LIT'");
while(rs2.next())
{
LIT_CH_RES=rs.getInt("LIT_CH_RES");
LIT_QUEUED_CH_RES=rs.getInt("LIT_QUEUED_CH_RES");
LIT_TBSCallTime=rs.getInt("LIT_TBSCallTime");
}
con.close();
}catch(SQLException e){}
运行后的错误:2008-10-25 21:43:22 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1059)
at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2719)
at org.apache.jsp.pic_jsp._jspService(pic_jsp.java:104)
哎 我知道怎么回事了 是我粗心了 心情不爽 弄什么都容易出错了
展开