ConnPoolWatch.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:1k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.currency.database.*,javax.servlet.*,javax.servlet.http.*,java.io.*,java.util.*" %>
  3. <html>
  4. <head>
  5. <title>数据库连接池监视</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  7. <meta http-equiv="pragma" content="no-cache">
  8. <meta http-equiv="REFRESH" content="1;URL=ConnPoolWatch.jsp">
  9. <script language="JavaScript">
  10.   setTimeout("self.location.reload();",1000);
  11. </script>
  12. </head>
  13. <body>
  14. <%
  15.     Hashtable pools = ConnectionPool.getConnPools();
  16.     out.println("<p align="center"><font size="32px" color="#008800">数据库连接池监视</font></p><p>当前共有" + pools.size() + "个连接池被激活!</p>");
  17.     for(int i=0;i<pools.size();i++)
  18.     {
  19.       DBConnectionPool connPool = (DBConnectionPool)pools.values().toArray()[i];
  20.       out.println("<hr>");
  21.       out.println("<p>连接池名称:" + connPool.Name + "</p>");
  22.       out.println("<p>最大连接数:" + connPool.intMaxConn + "</p>");
  23.       out.println("<p>当前连接数:" + connPool.ConnCount + "</p>");
  24.       out.println("<p>空闲连接数:" + connPool.FreeConn.size() + "</p>");
  25.       out.println("<p>繁忙连接数:" + connPool.BusyConn.size() + "</p>");
  26.     }
  27. %>
  28. </body>
  29. <html>