| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd ">
-
- <bean id="dataSource"
- class="cn.sinobest.framework.comm.transcation.AppRoutingDataSource">
- <property name="targetDataSources">
- <map key-type="java.lang.String">
- <entry key="ds" value-ref="dataSource1" /> <!-- 数据源1 -->
- <entry key="ds2" value-ref="dataSource2" /><!-- 数据源2 -->
- </map>
- </property>
- <property name="defaultTargetDataSource" ref="dataSource1" /> <!-- 默认数据源为datasource1 -->
- </bean>
- <!-- datasource配置2 注:测试使用 -->
- <bean id="dataSource1" class="org.apache.commons.dbcp.BasicDataSource"
- destroy-method="close">
- <property name="driverClassName">
- <value>${jdbc.driver}</value>
- </property>
- <property name="url">
- <value>${jdbc.url}</value>
- </property>
- <property name="username">
- <value>${jdbc.username}</value>
- </property>
- <property name="password">
- <value>${jdbc.password}</value>
- </property>
- <property name="minIdle">
- <value>${jdbc.minIdle}</value>
- </property>
- <property name="maxActive" >
- <value>${jdbc.maxActive}</value>
- </property>
- <property name="maxIdle">
- <value>${jdbc.maxIdle}</value>
- </property>
- <property name="initialSize">
- <value>${jdbc.initialSize}</value>
- </property>
- <property name="validationQuery" >
- <value>${jdbc.validationQuery}</value>
- </property>
- </bean>
-
- <!-- datasource配置2 注:测试使用 -->
- <bean id="dataSource2" class="org.apache.commons.dbcp.BasicDataSource"
- destroy-method="close">
- <property name="driverClassName">
- <value>${jdbc.driver2}</value>
- </property>
- <property name="url">
- <value>${jdbc.url2}</value>
- </property>
- <property name="username">
- <value>${jdbc.username2}</value>
- </property>
- <property name="password">
- <value>${jdbc.password2}</value>
- </property>
- <property name="minIdle">
- <value>${jdbc.minIdle2}</value>
- </property>
- <property name="maxActive" >
- <value>${jdbc.maxActive2}</value>
- </property>
- <property name="maxIdle">
- <value>${jdbc.maxIdle2}</value>
- </property>
- <property name="initialSize">
- <value>${jdbc.initialSize2}</value>
- </property>
- <property name="validationQuery" >
- <value>${jdbc.validationQuery2}</value>
- </property>
- </bean>
-
- </beans>
|