分类:
2008-07-25 18:18:19
web.xml
proxool
Admin
org.logicalcobwebs.proxool.admin.servlet.AdminServlet
Admin
/admin
test.jsp
<%@page import="java.sql.*"%>
<%
Connection connection = null;
try {
Class.forName("org.logicalcobwebs.proxool.ProxoolDriver");
connection = DriverManager.getConnection(
"proxool.test:org.gjt.mm.mysql.Driver:jdbc:mysql://localhost:3306/test",
"root",
"password"
);
} catch (Exception e) {
out.println(e)
}
out.println("OK");
%>
Pools
Defintition for test
Snapshot at 21:12:53
Proxool 0.7.2 (29-Apr-2003 00:33) |
WEB-INF/proxool.xml
xml-test
jdbc:mysql://localhost:3306/test
org.gjt.mm.mysql.Driver
10
select CURRENT_DATE
WEB-INF/proxool.properties
jdbc-0.proxool.alias=property-test
jdbc-0.proxool.driver-url=jdbc:mysql://localhost:3306/test
jdbc-0.proxool.driver-class=org.gjt.mm.mysql.Driver
jdbc-0.user=root
jdbc-0.password=password
jdbc-0.proxool.maximum-connection-count=10
jdbc-0.proxool.house-keeping-test-sql=select CURRENT_DATE
proxool
ServletConfigurator
org.logicalcobwebs.proxool.configuration.ServletConfigurator
xmlFile
WEB-INF/proxool.xml
1
Admin
org.logicalcobwebs.proxool.admin.servlet.AdminServlet
Admin
/admin
在程序中, 只需要利用到别名就可以呼叫 connection pool 里面的 connection 来使用了
<%@page import="java.sql.*;"%>
<%
Connection connection = null;
try {
Class.forName("org.logicalcobwebs.proxool.ProxoolDriver");
connection = DriverManager.getConnection("proxool.xml-test");
} catch (Exception e) {
out.println(e);
}
out.println("ok");
%>