Mar 9th, 2009, 12:06 AM
i have a reader which reads all data from table and puts in an object.Now when it comes to writing..the scenario is like....each row from the table is wriiteen to diff files...but my object is containing all the data...so i donno how to limit each line to each file.i tht i need diff items but if it was each colomn in a file tht wud work...when it comes to each row in diff file...i m stuck up....hope i was able to explain...i am using 1.1.4
Mar 9th, 2009, 12:41 AM
Why is your reader putting all of the data in an object? The framework is designed to pass each record to the writer. What ItemReader implementation are you using? Since you're reading from the database, you'd most likely want the JdbcCursorItemReader.
Also, proper spelling, punctuation, and spacing would make your posts much easier to read.
Mar 9th, 2009, 12:48 AM
ya i am using JdbcCursorItemReader.When i am reading from table now...u mean i should hav different reader with diff sql statement and diff mappers to a common writer..which writes to diff files...?
sorry bout grammer...
Mar 9th, 2009, 12:56 AM
1.i have a table with two rows...
2.used a JdbcCursorItemReader to read the two rows....
3.used a rowmapper to map.
4.a writer which writes to a file.
with the above sequence i am able to write both the rows to the file.
what i want exactly is to write each row to a different file.
so i can use line mapper to map to each line but how do i specify the line number?
do i write a custom mapper and a dao which will call this mapper with the line number..?
i feel that wud make it very complex...so wanted some simple solution....
hope ur getting me....
Mar 10th, 2009, 03:42 AM
My problem is solved..i am able to do what i wanted to thnq.....