MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » jsp调用存储过程后分页数据展示不出来

jsp调用存储过程后分页数据展示不出来(2)

www.MyException.Cn  网友分享于:2013-12-07  浏览:193次

intPageCount   =(intRowCount+intPageSize-1)/intPageSize;  
//调整待显示的页码  
if(intPage> intPageCount)   intPage=intPageCount;  
if(intPageCount> 0)  
//将记录指针定位到待显示页的第一条记录上  
rs.absolute((intPage-1)*intPageSize+1);  
//显示数据  
i=0;  







%>
<table   border= "1 "   width= "100% "   align= "center "   cellspacing= "0 "   cellpadding= "0 "   class= "f_sm ">
<%
out.println( " <tr> <td   align=center> <STRONG> 货品编码 </STRONG> </td> ");
out.println( " <td   align=center> <STRONG> 货品名称 </STRONG> </td> ");
out.println( " <td   align=center> <STRONG> 单位 </STRONG> </td> ");
out.println( " <td   align=center> <STRONG> 库存数量 </STRONG> </td> ");
out.println( " <td   align=center> <STRONG> 售货价 </STRONG> </td> ");
out.println( " <td   align=center> <STRONG> 提前订货期(天) </STRONG> </td> </tr> ");
DecimalFormat     df     =     new   DecimalFormat( "#0.00 ");    
while(i <intPageSize   &&!   rs.isAfterLast()){
out.println( " <tr> <td   align=center> "   +   rs.getString( "code ")   +   " </td> ");
out.println( " <td   align=center> "   +   rs.getString( "name ")   +   " </td> ");
out.println( " <td   align=center> "   +   rs.getString( "unit ")   +   " </td> ");
out.println( " <td   align=center> "   +   df.format(rs.getDouble( "tonhand "))   +   " </td> ");
out.println( " <td   align=center> "   +   df.format(rs.getDouble( "sprice "))   +   " </td> ");
out.println( " <td   align=center> "   +   rs.getInt( "leadtime ")   +   " </td> </tr> ");

}
%>
<%  
rs.next();  
i++;  

%>  
</table>
第 <%=intPage%> 页   共 <%=intRowCount%>   条记录/共 <%=intPageCount%> 页   <br>  
<%if(intPage <2){   %>   首页   |   上一页  
<%   }else{%>   <a   href= "page.jsp?page=1 "> 首页 </a> | <a   href= "page.jsp?page= <%=intPage-1%> "> 上一页 </a>  
<%}%>  
<%if((intPageCount-intPage) <1){   %> 下一页   |   尾页  
<%}else{%>  
<a   href= "page.jsp?page= <%=intPage+1%> "> 下一页 </a>   |   <a   href= "page.jsp?page= <%=intPageCount%> "> 尾页 </a>  
<%}%>  

<%
rs.close();
cstmt.close();
conn.close();
}catch   (Exception   e){
e.printStackTrace();
}
%>
</body>
</html>


------解决方案--------------------
估计是分页没处理好,把报错信息贴出来
------解决方案--------------------

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有