Results 1 to 2 of 2

Thread: JDBC Batch Update

  1. #1
    Join Date
    Jun 2009
    Posts
    5

    Default 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. #2
    Join Date
    Jul 2009
    Posts
    1

    Default

    I have the exact same question myself.

    Does anyone have any suggestions for us to try?

    Thanks.

Posting Permissions

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