java - Verifying success for spring JDBC batch update -
i using spring jdbctemplate batchupdate insert data in batch. want verify if data inserted. jdbctemplate batchupdate returns int[][], right way verify data inserted?
this link says "all batch update methods return int array containing number of affected rows each batch entry. count reported jdbc driver , it's not available in case jdbc driver returns -2 value". unable understand significance of returning -2 value here. means insert unsuccessful?
-2 not mean error, might mentioned, case of count of affected rows not available.
edit
-2 value of statement.success_no_info (while execute_failed -3). unless driver not comply jdbc specification, -2 unequivocally means success
end of edit
the errors reported via batchupdateexception
normally, if run n queries in batch script count of updates per query in result:
int result[] = jdbctemplate.batchupdate(sql);
so:
result[0]
will hold update count first query,
result[1]
will hold update count second query etc.
Comments
Post a Comment