Package org.springframework.jdbc.core

# Class AggregatedBatchUpdateException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
java.sql.BatchUpdateException
org.springframework.jdbc.core.AggregatedBatchUpdateException

All Implemented Interfaces:
  `Serializable`, `Iterable<Throwable>`

public class AggregatedBatchUpdateException extends BatchUpdateException
A `BatchUpdateException` that provides additional information about batches that were successful prior to one failing.

Since:
  6.2
Author:
  Stephane Nicoll
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`AggregatedBatchUpdateException(int[][] successfulUpdateCounts, BatchUpdateException original)`
Create an aggregated exception with the batches that have completed prior to the given `cause`.

## Method Summary

Modifier and Type
Method
Description
`BatchUpdateException`
`getOriginalException()`
Return the original `BatchUpdateException` that this exception aggregates.
`int[][]`
`getSuccessfulUpdateCounts()`
Return the batches that have completed successfully, prior to this exception.

### Methods inherited from class java.sql.BatchUpdateException

`getLargeUpdateCounts, getUpdateCounts`

### Methods inherited from class java.sql.SQLException

`getErrorCode, getNextException, getSQLState, iterator, setNextException`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Constructor Details

### AggregatedBatchUpdateException

public AggregatedBatchUpdateException(int[][] successfulUpdateCounts, BatchUpdateException original)
Create an aggregated exception with the batches that have completed prior to the given `cause`.

Parameters:
  `successfulUpdateCounts` - the counts of the batches that run successfully
  `original` - the exception this instance aggregates

## Method Details

### getSuccessfulUpdateCounts

public int[][] getSuccessfulUpdateCounts()
Return the batches that have completed successfully, prior to this exception.

Information about the batch that failed is available via `BatchUpdateException.getUpdateCounts()`.

Returns:
  an array containing for each batch another array containing the numbers of rows affected by each update in the batch
See Also:
  - `BatchUpdateException.getUpdateCounts()`

### getOriginalException

public BatchUpdateException getOriginalException()
Return the original `BatchUpdateException` that this exception aggregates.

Returns:
  the original exception