123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <?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:tx="http://www.springframework.org/schema/tx"
- xmlns:aop="http://www.springframework.org/schema/aop"
- 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/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
-
-
- <context:property-placeholder location="WEB-INF/config/config.properties"/>
- <!--
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
- <property name="driverClassName"><value>${config.jdbc.driverClassName}</value></property>
- <property name="url"><value>${config.jdbc.url}</value></property>
- <property name="username"><value>${config.jdbc.username}</value></property>
- <property name="password"><value>${config.jdbc.password}</value></property>
- <property name="maxActive"><value>${config.jdbc.maxActive}</value></property>
- <property name="maxIdle"><value>${config.jdbc.maxIdle}</value></property>
- <property name="maxWait"><value>${config.jdbc.maxWait}</value></property>
- <property name="connectionProperties" value="oracle.jdbc.V8Compatible=true;"/>
- <property name="testOnBorrow" value="true"/>
- <property name="testWhileIdle" value="true"/>
- </bean>
- -->
- <!--
- 通常来说,只需要修改initialSize、minIdle、maxActive。
- 如果用Oracle,则把poolPreparedStatements配置为true,mysql可以配置为false。分库分表较多的数据库,建议配置为false。
- -->
- <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
- init-method="init" destroy-method="close">
- <!-- 基本属性 url、user、password -->
- <property name="url" value="${config.jdbc.url}" />
- <property name="username" value="${config.jdbc.username}" />
- <property name="password" value="${config.jdbc.password}" />
- <!-- 配置初始化大小、最小、最大 -->
- <property name="initialSize" value="${config.jdbc.initialSize}" />
- <property name="minIdle" value="${config.jdbc.minIdle}" />
- <property name="maxActive" value="${config.jdbc.maxActive}" />
- <!-- 配置获取连接等待超时的时间 -->
- <property name="maxWait" value="${config.jdbc.maxWait}" />
- <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
- <property name="timeBetweenEvictionRunsMillis" value="60000" />
- <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
- <property name="minEvictableIdleTimeMillis" value="300000" />
- <!--
- <property name="validationQuery" value="SELECT 'x'" />
- -->
- <property name="validationQuery" value="select 1 from dual" />
- <property name="testWhileIdle" value="true" />
- <property name="testOnBorrow" value="false" />
- <property name="testOnReturn" value="false" />
- <!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
- <property name="poolPreparedStatements" value="true" />
- <property name="maxPoolPreparedStatementPerConnectionSize"
- value="20" />
- <!-- 配置监控统计拦截的filters -->
- <property name="filters" value="stat" />
- </bean>
-
- <!--
- <bean id="jdbcTemplate"
- class="org.springframework.jdbc.core.JdbcTemplate">
- <property name="dataSource" ref="dataSource" />
- </bean>
-
- <bean id="namedParameterJdbcTemplate"
- class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
- <constructor-arg name="dataSource" ref="dataSource"></constructor-arg>
- </bean>
- -->
-
- <bean id="transactionManager"
- class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource">
- <ref bean="dataSource" />
- </property>
- </bean>
-
- <tx:annotation-driven transaction-manager="transactionManager"/>
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <!--<property name="mapperLocations"></property>-->
- <property name="mapperLocations" value="classpath*:com/cxfws/**/xml/*Mapper.xml" />
- <property name="typeAliasesPackage" value="org.sjns.bean" />
- </bean>
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="com.cxfws.**.mapper" />
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
- </bean>
-
- <!-- 定时器配置 -->
- <bean id="schedule" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
- <property name="triggers">
- <list>
- <ref bean ="FZDtSynchTb"/>
- </list>
- </property>
- </bean>
- <!-- 许可证附证数据交换 定时器 -->
- <bean id="FZDtSynchTb" class="org.springframework.scheduling.quartz.CronTriggerBean">
- <property name="jobDetail" ref="FZDtSynchTbSxl" />
- <property name="cronExpression" value="0 0/2 * * * ?" />
- <!-- <property name="cronExpression" value="30 14 10 * * ? *" />-->
- </bean>
- <!-- 许可证附证定时器对应路径和方法 -->
- <bean id="FZDtSynchTbSxl" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
- <property name="targetObject" ref="FZSynchTbSxl" />
- <property name="targetMethod" value="webserviceCall" />
- <property name="concurrent" value="false"/>
- </bean>
- <bean id="FZSynchTbSxl" class="com.cxfws.demo.control.DemoController" scope="prototype">
- </bean>
-
- </beans>
|