1.spring-quartz.xml
如下代码 配置
1.指定具体的自定义的 定时任务类(自定义对象)
2.触发器收入此定时任务对象
3.调度器收入触发器
4.需要连接数据库--此处我用mybatis
5.整体项目已上传git,所需数据库在git项目中。
<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"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd" >
<context:component-scan base-package="com.ylz.quartz" />
<!-- 定时任务 -->
<bean id="myQuartzJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass">
<!-- 上面的任务代理类 -->
<value>com.ylz.quartz.bean.DetailQuartzJobBean</value>
</property>
<property name="jobDataAsMap">
<ma