Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Database to flatfile

  1. #11
    Join Date
    Mar 2009
    Posts
    12

    Default

    hi
    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

  2. #12
    Join Date
    Feb 2008
    Posts
    488

    Default

    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.

  3. #13
    Join Date
    Mar 2009
    Posts
    12

    Default

    hi
    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...

  4. #14
    Join Date
    Mar 2009
    Posts
    12

    Default

    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....

  5. #15
    Join Date
    Mar 2009
    Posts
    12

    Default

    My problem is solved..i am able to do what i wanted to thnq.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •