Announcement Announcement Module
Collapse
No announcement yet.
JDBC Batch Update Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JDBC Batch Update

    Hi,

    I'm trying to insert records in a table using batchUpdate method of JdbcTemplate. In some cases the operation may fail - due to unique key constraint for example.

    In such cases I would like the method either:

    1. skip the problematic items, complete inserting the remaining items and return something to convey which records where inserted/not inserted.

    or

    2. return the index of the first item that failed or something to identify the first problematic record.

    batchUpdate does returns an array of the number of rows affected by each statement, however in case of an exception as the one mentioned above, one doesn't get this information.

    Please let me know if there is any way to accomplish this.

    Regards,
    Priyank


    Regards,
    Priyank

  • #2
    I have the exact same question myself.

    Does anyone have any suggestions for us to try?

    Thanks.

    Comment

    Working...
    X