SpringBatch 에서 외부 parameter 값을 사용할 때.
org.springframework.batch.core.launch.support.CommandLineJobRunner 을 이용한 job 실행환경의 parameter 정보 : job/test/test-job.xml testJob batchBaseDate=20120830 -next
<bean id="sfaStgItemReader" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step">
<property name="resource" value="file:C:\Users\Inho\Desktop\#{jobParameters['batchBaseDate']}\test.txt" />
<property name="encoding" value="MS949" />
<property name="lineMapper">
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
<property name="lineTokenizer">
<bean class="com.inho.batch.comm.CustomFixedByteTokenizer">
<property name="names" value="baseDt,typeCd,acntNo,fnncInstnDivCd,nisInstnNm,overdueAmt,reckonDt" />
<property name="columns" value="2-7,8-8,9-21,22-25,26-125,126-155,156-163" />
</bean>
</property>
<property name="fieldSetMapper">
<bean class="org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper">
<property name="targetType" value="com.inho.batch.domain.TestInfo" />
</bean>
</property>
</bean>
</property>
</bean>
Spring scheduled (scheduling) 이용한 서버 모니터링 프로그램 (0) | 2014.06.11 |
---|---|
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for 문제시... (0) | 2014.05.16 |
[Spring batch] File to DB (0) | 2012.09.04 |
Spring3 + hibernate4 연동 (0) | 2012.09.04 |
Spring Batch Example 2 - DB to DB (1) (5) | 2012.07.24 |
댓글 영역