Mar 23rd, 2012, 02:38 AM
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!
Mar 23rd, 2012, 05:22 AM
Hi, see this post, may be useful to you.
Mar 26th, 2012, 01:27 AM
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.
Originally Posted by venosov
Tags for this Thread