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

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.*,com.gforce.currency.*" %>
  3. <%
  4. Request m_request = new Request(request);
  5. String strPoolName = m_request.GetString("PoolName");
  6. if(strPoolName.trim().length()>0)
  7. {
  8.   if(ConnectionPool.Instance().CloseAllConn(strPoolName)>0)
  9.   {
  10. %>
  11. <script language="JavaScript" type="text/JavaScript">
  12. alert("“<%=strPoolName%>”连接池重置成功!");
  13. window.location="<%=request.getRequestURI()%>";
  14. </script>
  15. <%
  16.   }
  17.   else
  18.   {
  19. %>
  20. <script language="JavaScript" type="text/JavaScript">
  21. alert("“<%=strPoolName%>”连接池不存在,重置失败!");
  22. history.back();
  23. </script>
  24. <%
  25.   }
  26. }
  27. else
  28. {
  29. %>
  30. <html>
  31. <head>
  32. <title>数据库连接池监视修复器</title>
  33. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  34. <meta http-equiv="pragma" content="no-cache">
  35. <meta http-equiv="REFRESH" content="1;URL=<%=request.getRequestURI()%>">
  36. <script language="JavaScript">
  37.   setTimeout("self.location.reload();",1000);
  38. </script>
  39. </head>
  40. <body>
  41. <%
  42.     Hashtable pools = ConnectionPool.getConnPools();
  43.     out.println("<p align="center"><font size="32px" color="#008800">数据库连接池监视修复器</font></p><p>当前共有" + pools.size() + "个连接池被激活!</p>");
  44.     for(int i=0;i<pools.size();i++)
  45.     {
  46.       DBConnectionPool connPool = (DBConnectionPool)pools.values().toArray()[i];
  47.       out.println("<hr>");
  48.       out.println("<p>连接池名称:" + connPool.Name + "</p>");
  49.       out.println("<p>最大连接数:" + connPool.intMaxConn + "</p>");
  50.       out.println("<p>当前连接总数:" + connPool.ConnCount + "</p>");
  51.       out.println("<p>空闲连接数:" + connPool.FreeConn.size() + "</p>");
  52.       out.println("<p>繁忙连接数:" + connPool.BusyConn.size() + "</p>");
  53.       out.println("<p align='right'><a href='" + request.getRequestURI() + "?PoolName=" + connPool.Name + "'>重置“" + connPool.Name + "”连接池</a></p>");
  54.     }
  55. %>
  56. </body>
  57. <html>
  58. <%
  59. }
  60. %>