Verification on jdbc driver's response to handling duplicates

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();
});

Yes this look accurate, although the row count could be 0 for other reasons like: no document found.

@smu is there a specific number that says they’re duplicates?

@bputt No there isn’t, all execution errors are treated the same (= not increasing the row count).