1

I am trying to use the batchUpdate on Springs jdbcTemplate but all i'm getting back is an int array of -3's. Below is the code I'm running. The array list "batch" contains inserts and updates.

String[] stmts = batch.toArray(new String[batch.size()]);
int[] result = jdbcTemplate.batchUpdate(stmts);

The result array contains [-3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, ... ]

Using - Spring 3.1.2.RELEASE - jtds driver 1.3.0 - SQL Server 2005

Has anyone come across this?

1 Answer 1

1

It was found that batchUpdate does not like comments in the sql it is given. Once the comments were removed the update worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.