0

I have following requirement.I am generating unique id from ItemProcessor and writing the same to database using JdbcItemWriter.

I wanted to pass this unique id as a query param in next JdbcItemReader,so that i can select all the records from database based on this unique id.

currently i am using max(uniqueid) from database.I have tried using {jobParameters['unqueid']} but it didn't worked.

Please let me know how to pass value from ItemProcessor to DataBaseItemReader.

murali
  • 71
  • 1
  • 3

1 Answers1

0

I think using step execution context might work for you here. There is the option for setting some transient data on the step execution context and having that be available to other components in the same step.

There is a previous answer here that elaborates a bit more on this and a quick google search on "spring batch step execution context" also provides quite a few q/a on the subject.

Community
  • 1
  • 1
Mark Kouba
  • 236
  • 2
  • 12