Spring批处理中的java执行批处理文件
我有一个学校的项目,在我的项目中,我想运行一个自动和定期执行的任务,如Windows任务调度程序,但我没有找到正确的代码这样做。我上商务舱,但我要做哪一步来安排工作? 如何运行批处理文件并安排作业
请告诉我谁能帮我
@SuppressWarnings("serial")
@Entity
@Table(name ="task")
public class Task implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Integer id;
@Column(name = "nom_job", length = 20,nullable = false)
private String nom_job;
@Column(name = "description", length = 100, nullable = false)
private String description;
@Column(name = "scriptFile", length = 100, nullable = false)
private String scriptFile;
@Column(name = "date_execution", length = 20,nullable = false)
private Date date_execution;
@Column(name = "temps_execution", length = 100, nullable = false)
private Date temps_execution;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNom_job() {
return nom_job;
}
public void setNom_job(String nom_job) {
this.nom_job = nom_job;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getScriptFile() {
return script;
}
public void setScriptFile(String script) {
this.script = script;
}
public Date getDate_exécution() {
return date_execution;
}
public void setDate_exécution(Date date_execution) {
this.date_execution = date_execution;
}
public Date getTemps_exécution() {
return temps_execution;
}
public void setTemps_exécution(Date temps_execution) {
this.temps_execution = temps_execution;
}
public Task(Integer id, String nom_job, String description, String scriptFile, Date
date_execution, Date temps_execution ) {
super();
this.id=id;
this.nom_job = nom_job;
this.description = description;
this.scriptFile = scriptFile;
this.date_execution = date_execution;
this.temps_execution = temps_execution;
}
}
共 (0) 个答案