Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:29:31+00:00 2026-05-26T10:29:31+00:00

I did some searching but couldn’t find any sample/example. I’ve a requirement where geo

  • 0

I did some searching but couldn’t find any sample/example.

I’ve a requirement where geo coordinates from one table (input) are read, processed to generate POI’s associated to coordinate. So one geo coordinate will result in one or more POI’s that needs to be inserted into another table (output).

I’m currently using a JdbcCursorItemReader and JdbcBatchItemWriter to read one item/record and write one item/record. There is also an ItemProcessor that generates the POI’s for a give geo coordinate.

Does a custom JdbcBatchItemWriter help me achieve this?

Any ideas? TIA.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:29:32+00:00Added an answer on May 26, 2026 at 10:29 am

    if you just want to spread the items to different writers (read duplicate output) you can use the existing CompositeItemWriter

    but i’m not sure if your processor will produce different item types or if you want to spread the content of one complex item type to multiple writers, for those cases you can use a slightly changed version for a multiline-record-writer question

    public class MultiOutputItemWriter implements ItemWriter<Object> {
    
    private JdbcBatchItemWriter<ClassFoo> delegateFoo;
    private JdbcBatchItemWriter<ClassBar> delegateBar;
    
    public void write(List<? extends Object> items) throws Exception {
           // if you have different types of items
           // check Object Class
           // add to new List<Classfoo>
           // call delegate e.g. delegateFoo.write(List with ClassFoo);
           //
           // or if you have complex objects
           // same procedure as above, but with
           // add to new List<Classfoo> with item.getClassFoo
     }
    }
    

    if you use FlatFileItemWriter, do not forget to register the delegates as ItemStreams (so spring batch will open/close them for you)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I did do some googling and searching on this site but did not find
Did some googling and couldn't find a clear answer on this. My assumption is
I did some fairly thorough reading and searching through SO and didn't find anything
I did some searching on this site and on google as well. But i
My apologies if this has been answered before or is obvious...did some searching here
I did some googling to try to answer this question but even after that
I did some timing tests and also read some articles like this one (last
I did a fair bit of searching for an answer to this question, but
I did a bit of searching but came up empty on this. I'm looking
Apologies if this has been covered before - I did my searching but possibly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.