Spring Batch提供一个任务的仓库实现将任务元数据保存在数据库中,以便监控你的批量处理进程以及其结果.
Spring Batch 数据库引擎支持的有:DB2,Derby, H2, HSQLDB,
MySQL, Oracle, PostgreSQL, SQLServer, and Sybase.
Job-Repository.xml 配置JobRepository到数据库中.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:batch="http://www.springframework.org/schema/batch"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/batch
http://www.springframework.org/schema/batch/spring-batch-2.1.xsd">
data-source="dataSource"transaction-manager="transactionManager" />
class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
主要是配置这三项内容:
1、batch的命名空间下创建一个jobRepository
2、数据源
3、事务管理器
—–下面有个“顶”字,你懂得O(∩_∩)O哈哈~
—–乐于分享,共同进步!