一,首先下载quartz-1.6.0.jar架包,到lib目录下
二,写你自己定时器业务方法
package com.lbnet.lzx.timing; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.beans.factory.BeanFactory; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.scheduling.quartz.QuartzJobBean; import com.lbnet.lzx.service.IOrderService; public class OrderNoRefact extends QuartzJobBean{ private static BeanFactory factory = new ClassPathXmlApplicationContext("applicationContext-*.xml"); @Override protected void executeInternal(JobExecutionContext arg0) throws JobExecutionException {

本文介绍了如何在SSH框架中集成Spring与Quartz实现定时任务。详细步骤包括添加quartz库,编写定时任务业务逻辑,配置Spring XML以设定定时参数,并解析了cron表达式的含义和用法,提供了多个具体的定时触发示例。

最低0.47元/天 解锁文章
594





