什么不多说直接上Demo:
vo类:
package it.quartz.job.test;
import java.io.Serializable;
import java.util.Date;
public class SelVo implements Serializable{
private static final long serialVersionUID = 2746434425903993053L;
private String name;
private Date testDate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getTestDate() {
return testDate;
}
public void setTestDate(Date testDate) {
this.testDate = testDate;
}
}
Job任务类:
package it.quartz.job.test;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.launch.support.SimpleJobLauncher;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class MyFirstJob {
private final String contextPath = PathHelper.getWEB_INF_Path()+"conf/quartz-test.xml";
private ApplicationContext ac = new ClassPathXmlApplicati