Results 1 to 3 of 3

Thread: BatchUpdateException with NamedParameterJdbcTemplate.batchUpdate

  1. #1
    Join Date
    Mar 2012
    Posts
    2

    Default BatchUpdateException with NamedParameterJdbcTemplate.batchUpdate

    Hello,

    I'm stuck with the following problem and was hoping you guys know a solution.

    When I'm executing a batch of insert statements with the NamedParameterJdbcTemplate.batchUpdate I get a DuplicateKeyException because of an IntegrityConstraintViolation. No problem. But I would like to know how many statements of the batch are executed so I can react on this exception.

    I'm using Oracle, and in there documentation they speak of a BatchUpdateException who has a method for retrieving the number of succesfully executed statments (int[] getUpdateCounts()).

    Any one an idea how I can do this with Spring / NamedParameterJdbcTemplate?

    Thanks in advance!

  2. #2
    Join Date
    May 2011
    Location
    Madrid (Spain)
    Posts
    101

    Default

    Hi, see this post, may be useful to you.

  3. #3
    Join Date
    Mar 2012
    Posts
    2

    Default

    Quote Originally Posted by venosov View Post
    Hi, see this post, may be useful to you.
    Thank you for the link. The problem with there solution is that they do not use the JdbcTemplate from Sping but just old plain Jdbc. I was more hoping the accomplish this with help of Sping but if that is impossible I can use the this solution.

Tags for this Thread

Posting Permissions

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