Hi,
I have typical batch situation, where I use JdbcCursorItemReader with prepared statement for reading database. PreparedStatement parameter values should be set from JobParameters dynamically.
My configuration is typical as below:
How can I attach stepContext or some other context (where jobParameters are) to my PreparedStatementSetter implementation? I need to get those jobParameter values to my SQL..Code:<bean id="itemReader" class="org.spr...JdbcCursorItemReader"> <property name="dataSource" ref="dataSource"/> <property name="sql" value="select ID, NAME, CREDIT from CUSTOMER where column=?"/> <property name="preparedStatementSetter" ref="mySetter"/> <property name="rowMapper"> <bean class="org.springframework.batch.sample.domain.CustomerCreditRowMapper"/> </property> </bean>


Reply With Quote