Commit a038b5cc authored by liling's avatar liling

add code

parent 8be29ec9
This diff is collapsed.
<?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:context="http://www.springframework.org/schema/context"
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-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean name="druidDataSource" parent="dataSourceParent">
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<bean id="druidSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="druidDataSource"/>
<property name="mapperLocations">
<array>
<value>classpath*:mybatis/druid/*.xml</value>
</array>
</property>
<property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml"/>
<property name="typeAliasesPackage" value="cn.com.duiba.dmp.common.entity"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionTemplateBeanName" value="druidSqlSessionTemplate"/>
<property name="basePackage" value="cn.com.duiba.dmp.dal.mapper.druid"/>
</bean>
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
default-autowire="byName">
<bean id="dataSourceParent" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" abstract="true">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="initialSize" value="3"/>
<property name="maxTotal" value="500"/>
<property name="minIdle" value="3"/>
<property name="maxIdle" value="5"/>
<property name="maxWaitMillis" value="30000"/>
<property name="removeAbandonedOnBorrow" value="true"/>
<!-- Timeout in seconds before an abandoned connection can be removed. Defaults to 300 seconds -->
<property name="removeAbandonedTimeout" value="60"/>
<property name="logAbandoned" value="true"/>
<property name="testOnBorrow" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="90000"/><!-- 多久testWhileIdle一次 -->
<property name="minEvictableIdleTimeMillis" value="600000"/><!-- 池中的连接空闲多久后被回收,默认值就是30分钟。 -->
<property name="validationQuery" value="SELECT 1"/>
<property name="testWhileIdle" value="true"/>
</bean>
<!-- 注解方式配置事务,在service中使用@Transactional使用事务,由于事务不能跨越数据库,必须指定value,比如consumer/credits -->
<tx:annotation-driven proxy-target-class="true" />
<bean name="dataSource" parent="dataSourceParent"> <!-- com.mchange.v2.c3p0.ComboPooledDataSource -->
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<!-- ========================================针对myBatis的配置项============================== -->
<!-- 配置sqlSessionFactory -->
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="dataSource"/>
<property name="typeAliasesPackage" value="cn.com.duia.dmp.common.entity"/>
</bean>
</constructor-arg>
</bean>
<!-- 配置Spring的事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
<qualifier value="dmp"/><!-- 使用@Transactional(DsConstants.DATABASE_QIHO)来指定使用该事务管理器 -->
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<?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:context="http://www.springframework.org/schema/context"
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-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
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.xsd"
default-autowire="byName">
<bean id="dataSourceParent1" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" abstract="true">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="initialSize" value="3"/>
<property name="maxTotal" value="500"/>
<property name="minIdle" value="3"/>
<property name="maxIdle" value="5"/>
<property name="maxWaitMillis" value="30000"/>
<property name="removeAbandonedOnBorrow" value="true"/>
<!-- Timeout in seconds before an abandoned connection can be removed. Defaults to 300 seconds -->
<property name="removeAbandonedTimeout" value="60"/>
<property name="logAbandoned" value="true"/>
<property name="testOnBorrow" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="90000"/><!-- 多久testWhileIdle一次 -->
<property name="minEvictableIdleTimeMillis" value="600000"/><!-- 池中的连接空闲多久后被回收,默认值就是30分钟。 -->
<property name="validationQuery" value="SELECT 1"/>
<property name="testWhileIdle" value="true"/>
</bean>
<bean name="druidServiceDataSource" parent="dataSourceParent1">
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<bean id="druidServiceSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="druidServiceDataSource"/>
<property name="mapperLocations">
<array>
<value>classpath*:mybatis/druid/*.xml</value>
</array>
</property>
<property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml"/>
<property name="typeAliasesPackage" value="cn.com.duia.tuia.test.manager.common.entity"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionTemplateBeanName" value="druidServiceSqlSessionTemplate"/>
<property name="basePackage" value="cn.com.duiba.dmp.dal.mapper.druid"/>
</bean>
<import resource="spring-datasource.xml"/>
<import resource="spring-datasource-druid.xml"/>
</beans>
\ No newline at end of file
<?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:context="http://www.springframework.org/schema/context"
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-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean name="druidDataSource" parent="dataSourceParent">
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<bean id="druidSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="druidDataSource"/>
<property name="mapperLocations">
<array>
<value>classpath*:mybatis/druid/*.xml</value>
</array>
</property>
<property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml"/>
<property name="typeAliasesPackage" value="cn.com.duiba.dmp.common.entity"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionTemplateBeanName" value="druidSqlSessionTemplate"/>
<property name="basePackage" value="cn.com.duiba.dmp.dal.mapper.druid"/>
</bean>
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
default-autowire="byName">
<bean id="dataSourceParent" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" abstract="true">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="initialSize" value="3"/>
<property name="maxTotal" value="500"/>
<property name="minIdle" value="3"/>
<property name="maxIdle" value="5"/>
<property name="maxWaitMillis" value="30000"/>
<property name="removeAbandonedOnBorrow" value="true"/>
<!-- Timeout in seconds before an abandoned connection can be removed. Defaults to 300 seconds -->
<property name="removeAbandonedTimeout" value="60"/>
<property name="logAbandoned" value="true"/>
<property name="testOnBorrow" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="90000"/><!-- 多久testWhileIdle一次 -->
<property name="minEvictableIdleTimeMillis" value="600000"/><!-- 池中的连接空闲多久后被回收,默认值就是30分钟。 -->
<property name="validationQuery" value="SELECT 1"/>
<property name="testWhileIdle" value="true"/>
</bean>
<!-- 注解方式配置事务,在service中使用@Transactional使用事务,由于事务不能跨越数据库,必须指定value,比如consumer/credits -->
<tx:annotation-driven proxy-target-class="true" />
<bean name="dataSource" parent="dataSourceParent"> <!-- com.mchange.v2.c3p0.ComboPooledDataSource -->
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<!-- ========================================针对myBatis的配置项============================== -->
<!-- 配置sqlSessionFactory -->
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="dataSource"/>
<property name="typeAliasesPackage" value="cn.com.duia.dmp.common.entity"/>
</bean>
</constructor-arg>
</bean>
<!-- 配置Spring的事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
<qualifier value="dmp"/><!-- 使用@Transactional(DsConstants.DATABASE_QIHO)来指定使用该事务管理器 -->
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<?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:context="http://www.springframework.org/schema/context"
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-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
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.xsd"
default-autowire="byName">
<bean id="dataSourceParent1" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" abstract="true">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="initialSize" value="3"/>
<property name="maxTotal" value="500"/>
<property name="minIdle" value="3"/>
<property name="maxIdle" value="5"/>
<property name="maxWaitMillis" value="30000"/>
<property name="removeAbandonedOnBorrow" value="true"/>
<!-- Timeout in seconds before an abandoned connection can be removed. Defaults to 300 seconds -->
<property name="removeAbandonedTimeout" value="60"/>
<property name="logAbandoned" value="true"/>
<property name="testOnBorrow" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="90000"/><!-- 多久testWhileIdle一次 -->
<property name="minEvictableIdleTimeMillis" value="600000"/><!-- 池中的连接空闲多久后被回收,默认值就是30分钟。 -->
<property name="validationQuery" value="SELECT 1"/>
<property name="testWhileIdle" value="true"/>
</bean>
<bean name="druidServiceDataSource" parent="dataSourceParent1">
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<bean id="druidServiceSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="druidServiceDataSource"/>
<property name="mapperLocations">
<array>
<value>classpath*:mybatis/druid/*.xml</value>
</array>
</property>
<property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml"/>
<property name="typeAliasesPackage" value="cn.com.duia.tuia.test.manager.common.entity"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionTemplateBeanName" value="druidServiceSqlSessionTemplate"/>
<property name="basePackage" value="cn.com.duiba.dmp.dal.mapper.druid"/>
</bean>
<import resource="spring-datasource.xml"/>
<import resource="spring-datasource-druid.xml"/>
</beans>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment