📄 secondindextype_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import com.huashi.util.jdbc.*;
public final class secondIndexType_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
"index1_error.jsp", true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=GBK\" />\r\n");
out.write(" <title>\r\n");
out.write(" 统计查询\r\n");
out.write(" </title>\r\n");
out.write(" </head>\r\n");
out.write(" <body bgcolor=\"#C0C0C0\">\r\n");
out.write("\r\n");
out.write(" <h1>\r\n");
out.write(" ");
Connection con = null;
try {
out.println("<table border=1 cellspacing=0 cellpadding=5 width=100% height=45>");
out.println("<tr><th width=50% ><font face=仿宋_GB2312 size=4>名称</font></th><th width=50% ><font face=仿宋_GB2312 size=4>数量</font></th></tr>");
int sum = 0;
// Class.forName("oracle.jdbc.driver.OracleDriver");
// con=DriverManager.getConnection("jdbc:oracle:oci:@ASCRAC","ascdata2","asc12345");
con = ConnectionUtil.getConnectionByJndiName("oracle/ascdb");
Statement statement_tmnl = con.createStatement();
String sql_tmnl =
" select "+
" a.type_desc,"+
" sum(decode(b.test_stat, 0, 1, 0))"+
" from "+
" asc_tmnl_type_dic_tbl a, "+
" asc_tmnl_info_tbl b "+
" where "+
" a.tmnl_type = b.tmnl_type "+
" group by "+
" a.type_desc ";
ResultSet rs_tmnl = statement_tmnl.executeQuery(sql_tmnl);
int total = 0;
out.println("<font color=#008080 face=仿宋_GB2312 size=5><u>设备类型统计</u></font><br/>");
while(rs_tmnl.next()){
sum = 0;
String type = rs_tmnl.getString(1);
sum = rs_tmnl.getInt(2);
//sum = sum+1;
total = total + sum;
out.println("<tr>");
String par1 = "tmnl device";
out.println("<td width=50% height=17><font color=#000000 face=仿宋_GB2312 size=4><a href=mobileTypeDetail.jsp?devicetype="+type+">"+type+"</a></font></td>");
out.println("<td align=center width=50% height=17><font color=#000000 face=仿宋_GB2312 size=4>"+sum+"</font></td>");
out.println("</tr>");
}
out.println("<tr>");
out.println("<th width=50% ><font face=仿宋_GB2312 size=4>合计</font></th>");
out.println("<td align=center width=50% height=17><font color=#000000 face=仿宋_GB2312 size=4>"+total+"</font></td>");
out.println("</tr>");
out.println("</table></br>");
out.println("<font color=#008080 face=仿宋_GB2312 size=5><u><a href=secondIndexCenter.jsp>分局安装情况统计</a></u></font></br>");
out.println("<font color=#008080 face=仿宋_GB2312 size=5><u><a href=secondIndexVehicle.jsp>车辆类型分布统计</a></u></font></br>");
out.println("<font color=#008080 face=仿宋_GB2312 size=5><u><a href=secondIndexAlarm.jsp>报警统计</a></u></font></br>");
out.println("<font color=#008080 face=仿宋_GB2312 size=5><u><a href=alarmcount.jsp>车机报警统计</a></u></font></br>");
statement_tmnl.close();
con.close();
} catch (Exception e) {
out.println(e.getMessage());
try{con.close();}catch(Exception ex){}
}
out.write("\r\n");
out.write(" </h1>\r\n");
out.write(" </body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -