| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
- 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.5.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-2.5.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
- <context:annotation-config />
- <bean id="popsConfig"
- class="com.yw.core.common.MutilPropertyPlaceholderConfigurer">
- <property name="locations">
- <list>
- <value>classpath:jdbc.properties</value>
- </list>
- </property>
- </bean>
- <!--
- <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
- <property name="driverClass" value="${jdbc.driverClassName}"/>
- <property name="jdbcUrl" value="${jdbc.url}"/>
- <property name="user" value="${jdbc.username}"/>
- <property name="password" value="${jdbc.password}"/>
- <property name="minPoolSize"><value>10</value></property>
- <property name="maxPoolSize"><value>300</value></property>
- <property name="maxIdleTime"><value>60</value></property>
- <property name="acquireIncrement"><value>2</value></property>
- <property name="maxStatements"><value>0</value></property>
- <property name="initialPoolSize"><value>20</value></property>
- <property name="idleConnectionTestPeriod"><value>60</value></property>
- <property name="acquireRetryAttempts"><value>50</value></property>
- <property name="testConnectionOnCheckout"><value>false</value></property>
- </bean>
- -->
- <bean id="MsSQLDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
- <property name="driverClass" value="${jdbc.msdriverClassName}"/>
- <property name="jdbcUrl" value="${jdbc.msurl}"/>
- <property name="user" value="${jdbc.msusername}"/>
- <property name="password" value="${jdbc.mspassword}"/>
- <property name="minPoolSize"><value>1</value></property>
- <property name="maxPoolSize"><value>20</value></property>
- <property name="maxIdleTime"><value>1800</value></property>
- <property name="acquireIncrement"><value>2</value></property>
- <property name="maxStatements"><value>0</value></property>
- <property name="initialPoolSize"><value>2</value></property>
- <property name="idleConnectionTestPeriod"><value>1800</value></property>
- <property name="acquireRetryAttempts"><value>30</value></property>
- <property name="testConnectionOnCheckout"><value>false</value></property>
- </bean>
- <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">
- <property name="url" value="${jdbc.url}" />
- <property name="username" value="${jdbc.username}" />
- <property name="password" value="${jdbc.password}" />
- <property name="filters" value="stat" />
- <property name="maxActive" value="20" />
- <property name="initialSize" value="1" />
- <property name="maxWait" value="60000" />
- <property name="minIdle" value="1" />
- <property name="timeBetweenEvictionRunsMillis" value="3000" />
- <property name="minEvictableIdleTimeMillis" value="300000" />
- <property name="validationQuery" value="SELECT 'x'" />
- <property name="testWhileIdle" value="true" />
- <property name="testOnBorrow" value="false" />
- <property name="testOnReturn" value="false" />
- <property name="poolPreparedStatements" value="true" />
- <property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
- </bean>
-
- <!-- 注册一个JDBC数据源事务管理器 -->
- <bean id="transactionManager"
- class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="dataSource" />
- </bean>
- <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
- <constructor-arg ref="dataSource" />
- </bean>
-
- <bean id="jdbcMSSQLSupport" class="com.yw.core.common.JdbcMSSQLSupport">
- <constructor-arg ref="MsSQLDataSource" />
- </bean>
-
- <bean id="defaultCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
- <property name="configLocation">
- <value>classpath:ehcache.xml</value>
- </property>
- </bean>
- <!-- 定义ehCache的工厂,并设置所使用的Cache name -->
- <bean id="ehCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
- <property name="cacheManager">
- <ref local="defaultCacheManager"/>
- </property>
- <property name="cacheName">
- <value>DEFAULT_CACHE</value>
- </property>
- </bean>
-
- <tx:annotation-driven transaction-manager="transactionManager" />
- <bean class="com.yw.core.utils.SpringUtil" />
- </beans>
|