int pg=1; //当前页数记录
int count=0; //取得数据数目
int count2=0; //记录条数
int pagenum; //总页数
String pgsql=\"\";
String sql=\"\";
String status=\"\"; //
查询条件
if(request.getParameter(\"starttime\")!=null && !request.getParameter(\"starttime\").equals(\"\")){
status=status+\" and logdate > cast(’\"+request.getParameter(\"starttime\")+\"’ as datetime)\";
}
if(request.getParameter(\"stoptime\")!=null && !request.getParameter(\"stoptime\").equals(\"\")){
status=status+\" and logdate < cast(’\"+request.getParameter(\"stoptime\")+\"’ as datetime)\";
}
pgsql=\"select count(*) as num from TB_LOG4J where priority = ’info’ \"+status;
//System.out.println(pgsql);
ResultSet res=Database.SQLQuery(conn,pgsql);
if(res.next()){ //查得数据条数
count=res.getInt(\"num\");
count2=count;
}
res.close();
for(pagenum=0;count>0;pagenum++){ //分页
count=count-perpg;
}
if (request.getParameter(\"page\")!=null && !request.getParameter(\"page\").equals(\"\")){
pg=Integer.parseInt(request.getParameter(\"page\"));
if (pg>pagenum){
pg=pagenum;
}
else if(pg<=1){
pg=1;
}
}
sql = \"select top 15 * from TB_LOG4J where logdate not in (select top \"+(pg-1)*perpg+\" logdate from TB_LOG4J where priority = ’info’ \"+status+\" order by logdate desc) and priority=’info’ \"+status+\" order by logdate desc\"; //sql server [Page]
//System.out.println(sql);
res=Database.SQLQuery(conn,sql);
while (res.next()){%>
<tr>
<td height=\"22\" align=\"center\"><%=res.getString(\"priority\")%></td>
<td align=\"center\"><%=res.getString(\"logdate\")%></td>
&n