I am trying to get a correct number of inserted rows for any jdbc (using batch and prepared statement). Now I know 2 ways:
PreparedStatement.getUpdateCount()- But for batches this method returns 1 for every batch even if every row was rejected.int[]as result ofPreparedStatement.executeBatch()and check every element if it is greater than 0. But for some jdbcs (for example Oracle) this array could contain -2 for every record.
So, is there any way to know the number of successfully inserted rows?