proxool配置及使用

jdbc XML配置:

 <proxool>
     <alias>apple</alias>
     <driver-url>jdbc:hsqldb:.</driver-url>
     <driver-class>org.hsqldb.jdbcDriver</driver-class>
     <driver-properties>
         <property name="user" value="abc" />
         <property name="password" value="def" />
     </driver-properties>
     <house-keeping-sleep-time>40000</house-keeping-sleep-time>
     <house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql>
     <maximum-connection-count>10</maximum-connection-count>
     <minimum-connection-count>3</minimum-connection-count>
     <maximum-connection-lifetime>18000000</maximum-connection-lifetime> <!-- 5 hours -->
     <simultaneous-build-throttle>5</simultaneous-build-throttle>
     <recently-started-threshold>40000</recently-started-threshold>
     <overload-without-refusal-lifetime>50000</overload-without-refusal-lifetime>
     <maximum-active-time>60000</maximum-active-time>
     <verbose>true</verbose>
     <trace>true</trace>
     <fatal-sql-exception>ORA-1234</fatal-sql-exception>
     <prototype-count>2</prototype-count>
 </proxool>

 

jdbc property配置:

 jdbc-0.proxool.alias=property-test
 jdbc-0.proxool.driver-url=jdbc:hsqldb:.
 jdbc-0.proxool.driver-class=org.hsqldb.jdbcDriver
 jdbc-0.user=foo
 jdbc-0.password=bar
 jdbc-0.proxool.house-keeping-sleep-time=40000
 jdbc-0.proxool.house-keeping-test-sql=select CURRENT_DATE
 jdbc-0.proxool.maximum-connection-count=10
 jdbc-0.proxool.minimum-connection-count=3
 jdbc-0.proxool.maximum-connection-lifetime=18000000
 jdbc-0.proxool.simultaneous-build-throttle=5
 jdbc-0.proxool.recently-started-threshold=40000
 jdbc-0.proxool.overload-without-refusal-lifetime=50000
 jdbc-0.proxool.maximum-active-time=60000
 jdbc-0.proxool.verbose=true
 jdbc-0.proxool.trace=true
 jdbc-0.proxool.fatal-sql-exception=Fatal error
 jdbc-0.proxool.prototype-count=2

 jdbc-1.proxool.alias=property-test-2
 jdbc-1.proxool.driver-url=jdbc:hsqldb:.
 jdbc-1.proxool.driver-class=org.hsqldb.jdbcDriver
 jdbc-1.user=scott
 jdbc-1.password=tiger
 jdbc-1.proxool.house-keeping-sleep-time=40000
 jdbc-1.proxool.house-keeping-test-sql=select CURRENT_DATE
 jdbc-1.proxool.maximum-connection-count=10
 jdbc-1.proxool.minimum-connection-count=3
 jdbc-1.proxool.maximum-connection-lifetime=18000000
 jdbc-1.proxool.simultaneous-build-throttle=5
 jdbc-1.proxool.recently-started-threshold=40000
 jdbc-1.proxool.overload-without-refusal-lifetime=50000
 jdbc-1.proxool.maximum-active-time=60000
 jdbc-1.proxool.verbose=true
 jdbc-1.proxool.trace=true
 jdbc-1.proxool.fatal-sql-exception=Fatal error
 jdbc-1.proxool.prototype-count=2

 

 

 

xml加载使用:

JAXPConfigurator.configure("src/java-test/org/logicalcobwebs/proxool/configuration/test-no-ns.xml", false);
connection = DriverManager.getConnection("proxool.xml-test");

 

properties加载使用:

PropertyConfigurator.configure("src/java-test/org/logicalcobwebs/proxool/configuration/test.properties");
connection = DriverManager.getConnection("proxool.property-test");

 

 

你可能感兴趣的:(proxool)