Announcement Announcement Module
No announcement yet.
BatchUpdateException with NamedParameterJdbcTemplate.batchUpdate Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • BatchUpdateException with NamedParameterJdbcTemplate.batchUpdate


    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
    Hi, see this post, may be useful to you.


    • #3
      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.