Spring MVC 多数据源实践
数据库情况:A数据库(oracle)+B数据库(Mysql) 一、applicationContext.xml配置 <!-- A库 --> <bean id="dataSourceA" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> ………… </bean> <!-- B库 --> <bean id="dataSourceB" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> ………… </bean> <!-- 动态数据源 --> <bean id="dynamicDataSource" class="edu.portal.demo.dataSource.DynamicDataSource"> <property name="targetDataSources"> <map key-type="java.lang.String"> <entry key="dbA" value-ref="dataSourceA" /> <entry key="dbB" value-ref="dataSourceB" /> </map> </property> <property name=