spring 配置proxool连接池,使用外部文件

proxool.properties

 

 

proxool.driver=oracle.jdbc.driver.OracleDriver

proxool.username=username proxool.password=userpwd proxool.url=jdbc:oracle:thin:@192.168.1.12:1521:orcl

proxool.alias=Database-----连接池别名

proxool.prototypeCount=2

proxool.maximumConnectionCount=500 --最大链接数

proxool.minimumConnectionCount=50 --最小链接数

proxool.trace=true

proxool.verbose=true

 

 

proxool.xml

 

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

 <bean id="propertyConfigurer"
  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="location">
   <value>classpath:jdbc.properties</value>
  </property>
 </bean>
 <bean id="dataSource"
  class="org.logicalcobwebs.proxool.ProxoolDataSource">
  <property name="driver">
   <value>${proxool.driver}</value>
  </property>
  <property name="driverUrl">
   <value>${proxool.url}</value>
  </property>
  <property name="user">
   <value>${proxool.username}</value>
  </property>
  <property name="password">
   <value>${proxool.password}</value>
  </property>
  <property name="alias">
   <value>${proxool.alias}</value>
  </property>
  <property name="prototypeCount">
   <value>${proxool.prototypeCount}</value>
  </property>
  <property name="maximumConnectionCount">
   <value>${proxool.maximumConnectionCount}</value>
  </property>
  <property name="minimumConnectionCount">
   <value>${proxool.minimumConnectionCount}</value>
  </property>
  <property name="trace">
   <value>${proxool.trace}</value>
  </property>
  <property name="verbose">
   <value>${proxool.verbose}</value>
  </property>
 </bean>

</beans>

你可能感兴趣的:(spring,oracle,bean,xml,jdbc)