ResetConnPool.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:2k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312"%>
- <%@ page import="com.gforce.currency.database.*,javax.servlet.*,javax.servlet.http.*,java.io.*,java.util.*,com.gforce.currency.*" %>
- <%
- Request m_request = new Request(request);
- String strPoolName = m_request.GetString("PoolName");
- if(strPoolName.trim().length()>0)
- {
- if(ConnectionPool.Instance().CloseAllConn(strPoolName)>0)
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("“<%=strPoolName%>”连接池重置成功!");
- window.location="<%=request.getRequestURI()%>";
- </script>
- <%
- }
- else
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("“<%=strPoolName%>”连接池不存在,重置失败!");
- history.back();
- </script>
- <%
- }
- }
- else
- {
- %>
- <html>
- <head>
- <title>数据库连接池监视修复器</title>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="REFRESH" content="1;URL=<%=request.getRequestURI()%>">
- <script language="JavaScript">
- setTimeout("self.location.reload();",1000);
- </script>
- </head>
- <body>
- <%
- Hashtable pools = ConnectionPool.getConnPools();
- out.println("<p align="center"><font size="32px" color="#008800">数据库连接池监视修复器</font></p><p>当前共有" + pools.size() + "个连接池被激活!</p>");
- for(int i=0;i<pools.size();i++)
- {
- DBConnectionPool connPool = (DBConnectionPool)pools.values().toArray()[i];
- out.println("<hr>");
- out.println("<p>连接池名称:" + connPool.Name + "</p>");
- out.println("<p>最大连接数:" + connPool.intMaxConn + "</p>");
- out.println("<p>当前连接总数:" + connPool.ConnCount + "</p>");
- out.println("<p>空闲连接数:" + connPool.FreeConn.size() + "</p>");
- out.println("<p>繁忙连接数:" + connPool.BusyConn.size() + "</p>");
- out.println("<p align='right'><a href='" + request.getRequestURI() + "?PoolName=" + connPool.Name + "'>重置“" + connPool.Name + "”连接池</a></p>");
- }
- %>
- </body>
- <html>
- <%
- }
- %>