1

I need to read from database table using three different queries. The rowmapper is going to be common, but I have three queries to fetch records from before I can move on to the next step of processing them. I do not want to use the union operator and create a single query.

I initially thought of using: MultiResourceItemReader , but that I guess can be used only when we read from multiple files.

Any help or pointers would be of real help.

Thanks, Rahul

RDM
  • 1,136
  • 3
  • 28
  • 50
  • 1
    You have to write your own `ItemReader`. Maybe https://github.com/RBGKew/powop/blob/master/emonocot-harvest/src/main/java/org/emonocot/harvest/common/CompositeItemReader.java can be a good starting point – Luca Basso Ricci Dec 23 '15 at 10:38
  • 1
    Thanks Luca, I would have a look at this. I was just thinking if such feature already exists in Spring Batch. – RDM Dec 23 '15 at 11:15
  • Came across this answer : http://stackoverflow.com/questions/21304364/spring-batch-job-read-from-multiple-database – Saifuddin Merchant Dec 25 '15 at 13:35
  • I agree, they have this exact type of thing for processors and writers, why not for readers? – ekcrisp Nov 12 '19 at 17:55

0 Answers0