首页>代码>Spring Batch入门教程及其框架搭建>/SpringBatchHelloWorld/src/main/java/com/wanggc/springbatch/sample/helloworld/JobLaunch.java
package com.wanggc.springbatch.sample.helloworld; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class JobLaunch { /** * @param args */ public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("batch_hello.xml"); JobLauncher launcher = (JobLauncher) context.getBean("jobLauncher"); Job job = (Job) context.getBean("helloWorldJob"); try { /* 运行Job */ JobExecution result = launcher.run(job, new JobParameters()); /* 处理结束,控制台打印处理结果 */ System.out.println("result="+result.toString()); } catch (Exception e) { e.printStackTrace(); } } }

changup LV6
2022年2月2日
雾岛听风 LV7
2021年10月20日
lovejing LV7
2020年5月16日
laowantong260 LV7
2020年1月18日
Zhangjifeng LV3
2019年6月21日
aaaaaSAAAA LV1
2019年4月8日
gxh2017 LV6
2019年3月28日
412059770 LV2
2019年1月18日
bdkwxz LV10
2019年1月14日
机智的我 LV17
2019年1月2日