<?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:context="http://www.springframework.org/schema/context"
xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd"> <!--使Spring支持自动检测组件,如注解的@Controller -->
<context:component-scan base-package="com.parry.test.*" />
<bean
class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" />
<bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /> <!-- 数据库配置 -->
<bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource"
destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<!-- 测试数据库 -->
<property name="jdbcUrl"
value="jdbc:mysql://127.0.0.1:3066/TESTDB?useUnicode=true&amp;characterEncoding=UTF-8&amp;allowMultiQueries=true" />
<property name="username" value="root" />
<property name="password" value="root" /> <!-- 检查数据库连接池中空闲连接的间隔时间,单位是分,默认值:240,如果要取消则设置为0 -->
<property name="idleConnectionTestPeriod" value="240" />
<!-- 连接池中未使用的链接最大存活时间,单位是分,默认值:30,如果要永远存活设置为0 -->
<!-- 数据库连接池过期时间应小于等于mysql的过期时间和mycat的过期时间 -->
<property name="idleMaxAge" value="20" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="100" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="20" />
<!-- 分区数 ,默认值2,最小1,推荐3-4,视应用而定 -->
<property name="partitionCount" value="1" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值:2 -->
<property name="acquireIncrement" value="2" />
<!-- 缓存prepared statements的大小,默认值:0 -->
<property name="statementsCacheSize" value="0" />
<property name="connectionTimeoutInMs" value="100" />
<!-- 每个分区释放链接助理进程的数量,默认值:3,除非你的一个数据库连接的时间内做了很多工作,不然过多的助理进程会影响你的性能 -->
<property name="releaseHelperThreads" value="3" />
</bean>
<!-- 配置SqlSessionFactoryBean -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:mybatis.xml" />
<!-- mapper和resultmap配置路径 -->
<property name="mapperLocations">
<list>
<!-- 表示在com.sfpay.mapper包或以下所有目录中,以-resultmap.xml结尾所有文件 -->
<value>classpath:com/parry/test/dao/config/*.xml</value>
</list>
</property>
</bean>
<!-- 配置mapper接口 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.cn21.calendar.dao" />
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory" />
</bean>
<!-- 事务配置 -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 用于持有ApplicationContext,可以使用SpringContextHolder.getBean('xxxx')的静态方法得到spring
bean对象 -->
<bean class="com.parry.test.springcontext.SpringContextHolder"
lazy-init="false" /> <!-- 定时器 begin -->
<!-- 赛程 调度业务对象 -->
<bean id="deletePastOrderJob" class="com.parry.test.function.PublicTypeFunction" />
<!-- 赛程 调度业务 -->
<bean id="deletePastOrderTask"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="deletePastOrderJob" />
<property name="targetMethod" value="deletePastOrder" />
</bean>
<!-- 赛程 调度器触发器 每天早上07:00执行一次 -->
<bean id="deletePastOrderTaskTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="deletePastOrderTask" />
<property name="cronExpression" value="0 13 09 * * ? *" />
</bean>
<!-- 设置调度 -->
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<!-- <ref bean="deletePastOrderTaskTrigger" /> -->
</list>
</property>
</bean>
<!-- 定时器 end -->
<!-- 服务器启动,初始化项目配置参数 -->
<bean name="InitalizeBean" class="com.parry.test.configure.impl.InitalizeBean" />
</beans>

最新文章

  1. Android 获取系统相册中的所有图片
  2. 说说IT技术团队招聘那点事
  3. Diophantus of Alexandria[HDU1299]
  4. JavaScript笔记——引用类型之Object类型和Function类型
  5. 使用jquery form插件进行异步带文件的表单提交
  6. [转自Kevins的天空 http://rootsec.cn]rad studio 2007 up3方法
  7. HBase shell
  8. PL/SQL常用设置 可看引用位置更清晰直观 引自:http://blog.csdn.net/xiaoqforever/article/details/27695569
  9. HTML表格标签
  10. 【推理】UVa 10771 - Barbarian tribes
  11. 递归查找某个目录下是否存在NOTICE文件
  12. libcurl的封装,支持同步异步请求,支持多线程下载,支持https
  13. cocos2d-x-3.1在eclipse中的环境搭建
  14. 具体评论ExpandableListView显示和查询模仿QQ组列表用户信息
  15. PHP文件夹操作
  16. c语言二叉树的递归建立
  17. Linux 3.2中回写机制的变革
  18. CF368 D - Persistent Bookcase
  19. June 6. 2018 Week 23rd Wednesday
  20. [编程笔记]第二章 C语言预备知识

热门文章

  1. ui.datepicker的回显问题
  2. react+webpack 引入字体图标
  3. ios 逆向工程文档汇总
  4. [pytorch] Pytorch入门
  5. 软件架构中的SOA架构有哪些特点?
  6. 将base64编码转换图片
  7. 动态生成的DOM做点击事件无效
  8. django Ajax介绍
  9. Webpack4 学习笔记二 CSS模块转换
  10. 解题:在下面画线的地方填任何代码,使得最终输出 &#39;hello world&#39;,至少写五个不同思路的方案