jobs.batchUpdateJob.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-batch-samples
Show all versions of spring-batch-samples
Example batch jobs using Spring Batch Core and Execution.
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd"> <description>Example for SQL Batch Update integration.</description> <bean id="batchUpdateJob" parent="simpleJob"> <!-- set restartable=false so that this job can be used by more than one test --> <property name="restartable" value="false" /> <property name="steps"> <bean id="step1" parent="skipLimitStep"> <property name="skipLimit" value="5" /> <property name="itemReader" ref="itemReader" /> <property name="itemWriter" ref="itemWriter" /> <property name="commitInterval" value="3" /> </bean> </property> </bean> <bean id="itemWriter" class="org.springframework.batch.item.database.BatchSqlUpdateItemWriter"> <property name="jdbcTemplate" ref="jdbcTemplate" /> <property name="sql"> <util:constant static-field="org.springframework.batch.sample.domain.trade.internal.CustomerCreditUpdatePreparedStatementSetter.QUERY"/> </property> <property name="itemPreparedStatementSetter"> <bean class="org.springframework.batch.sample.domain.trade.internal.CustomerCreditUpdatePreparedStatementSetter" /> </property> </bean> <bean id="itemReader" class="org.springframework.batch.item.database.JdbcCursorItemReader"> <property name="dataSource" ref="dataSource" /> <property name="sql" value="SELECT id, name, credit FROM customer " /> <property name="mapper"> <bean class="org.springframework.batch.sample.domain.trade.internal.CustomerCreditRowMapper" /> </property> </bean> </beans>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy