PDA

View Full Version : Composite writer to write in file and update the databse



swarupashet
Dec 20th, 2010, 06:29 AM
How to write the composite writer which will write the flat file as well as update the database?

bwawok
Dec 20th, 2010, 04:34 PM
CompositeItemWriter ? Look at example likes:

http://www.ecomputercoach.com/index.php/component/content/article/78-spring-batch-compositeitemwriter.html?showall=1

swarupashet
Dec 20th, 2010, 11:19 PM
Thanks for your replay , I already looked at the example , And i am looking out for something with which i will be able to write to Database as well as to file. Can you provide me such an example?

bwawok
Dec 21st, 2010, 07:13 AM
I can't provide an exact example, because I don't use composite item writer.. I wrote my own version of it that is slightly different.

My guess is, it shouldn't be much harder than a database writer, and a file writer, just added together. have you gotten a database writer and file writer to work? I believe the examples that come with spring batch have several of each.