- <?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:aop=”http://www.springframework.org/schema/aop”
- xmlns:tx=”http://www.springframework.org/schema/tx”
- xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd”>
- <bean id=”jotm” class=”org.springframework.transaction.jta.JotmFactoryBean”/>
- <bean id=”txManager” class=”org.springframework.transaction.jta.JtaTransactionManager”>
- <property name=”userTransaction” ref=”jotm”/>
- </bean>
- <bean id=”dataSourceA” class=”org.enhydra.jdbc.pool.StandardXAPoolDataSource”
- destroy-method=”shutdown”>
- <property name=”dataSource”>
- <bean class=”org.enhydra.jdbc.standard.StandardXADataSource” destroy-method=”shutdown”>
- <property name=”transactionManager” ref=”jotm”/>
- <property name=”driverName” value=”oracle.jdbc.driver.OracleDriver”/>
- <property name=”url” value=”jdbc:oracle:thin:@10.2.224.44:1521:trade”/>
- </bean>
- </property>
- <property name=”user” value=”crm_aep”/>
- <property name=”password” value=”crm_aep”/>
- </bean>
- <bean id=”dataSourceB” class=”org.enhydra.jdbc.pool.StandardXAPoolDataSource”
- destroy-method=”shutdown”>
- <property name=”dataSource”>
- <bean class=”org.enhydra.jdbc.standard.StandardXADataSource” destroy-method=”shutdown”>
- <property name=”transactionManager” ref=”jotm”/>
- <property name=”driverName” value=”oracle.jdbc.driver.OracleDriver”/>
- <property name=”url” value=”jdbc:oracle:thin:@10.2.226.24:1521:voucher”/>
- </bean>
- </property>
- <property name=”user” value=”boss”/>
- <property name=”password” value=”boss”/>
- </bean>
- <tx:annotation-driven transaction-manager=”txManager” proxy-target-class=”true” />
- <!– 第一个数据库的sqlMapClient –>
- <bean id=”sqlMapClient1″ class=”org.springframework.orm.ibatis.SqlMapClientFactoryBean”>
- <property name=”configLocation”>
- <!– 包含第一个数据库表的map –>
- <value>classpath:SqlMapConfig_ora1.xml</value>
- </property>
- <property name=”dataSource” ref=”dataSourceA” />
- </bean>
- <!– 第二个数据库的sqlMapClient –>
- <bean id=”sqlMapClient2″ class=”org.springframework.orm.ibatis.SqlMapClientFactoryBean”>
- <property name=”configLocation”>
- <!– 包含第一个数据库表的map –>
- <value>classpath:SqlMapConfig_ora2.xml</value>
- </property>
- <property name=”dataSource” ref=”dataSourceB” />
- </bean>
- <bean id=”product1Dao” class=”com.crm.code.dao.impl.Product1DaoImpl”>
- <property name=”sqlMapClient”>
- <ref bean=”sqlMapClient1″/>
- </property>
- </bean>
- <bean id=”product2Dao” class=”com.crm.code.dao.impl.Product2DaoImpl”>
- <property name=”sqlMapClient”>
- <ref bean=”sqlMapClient2″/>
- </property>
- </bean>
- <bean id=”product12Service” class=”com.crm.code.service.impl.Product12ServiceImpl”>
- <property name=”product1Dao”>
- <ref bean=”product1Dao” />
- </property>
- <property name=”product2Dao”>
- <ref bean=”product2Dao” />
- </property>
- </bean>
- </beans>