开发者

Efficient way to query database from a program processing big list of items

I have a spring batch program with itemReader, itemProcessor and itemWriter.

Say I have 10,000 records to process. For each item I want to fetch data 开发者_高级运维from several database table for deciding some conditions and adding some data.

I believe this will be done during processing.

Question: What is the best design to do this ? I am bit skeptic about running several Select queries for each item injecting SimpleJdbcTemplate in itemProcessor. Is there any other efficient way to do this ??

Thanks in advance!! Nik


Perhaps you should insert the 10,000 "POJOs" into a table in the datanbase, and then run a query that joins that to the other tables?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜