I wanted to make sure we’re handling our logic for duplicate values correctly.
We’re using the JDBC driver and are batching ~500 records at a time and we’re looking at the response coming back to count the number of errors, success, and duplicates.
The question is whether or not the psuedo code below is an accurate representation on the response we’ll get back and whether or not an int=0 represents a duplicate.
Arrays.stream(rows).forEach(i -> {
if (i >= 1) incrementSuccess();
else if (i == 0) incrementDuplicates();
else if (i == java.sql.PreparedStatement.SUCCESS_NO_INFO) incrementSuccess();
else if (i == java.sql.PreparedStatement.EXECUTE_FAILED) incrementFailures();
else incrementFailures();
});