}
// Ensure BatchUpdateExceptions have matching update counts
if ((exception1 instanceof BatchUpdateException) && (exception2 instanceof BatchUpdateException))
{
BatchUpdateException e1 = (BatchUpdateException) exception1;
BatchUpdateException e2 = (BatchUpdateException) exception2;
int[] counts1 = e1.getUpdateCounts();
int[] counts2 = e2.getUpdateCounts();
if ((counts1 != null) && (counts2 != null) ? !Arrays.equals(counts1, counts2) : (counts1 != counts2))
{
return false;
}
}
else if ((exception1 instanceof SQLClientInfoException) && (exception2 instanceof SQLClientInfoException))
{
SQLClientInfoException e1 = (SQLClientInfoException) exception1;
SQLClientInfoException e2 = (SQLClientInfoException) exception2;
Map<String, ClientInfoStatus> map1 = e1.getFailedProperties();
Map<String, ClientInfoStatus> map2 = e2.getFailedProperties();
return (map1 != null) && (map2 != null) ? map1.equals(map2) : (map1 != map2);
}
else if ((exception1 instanceof DataTruncation) && (exception2 instanceof DataTruncation))
{
DataTruncation e1 = (DataTruncation) exception1;
DataTruncation e2 = (DataTruncation) exception2;
return (e1.getDataSize() == e2.getDataSize()) && (e1.getIndex() == e2.getIndex()) && (e1.getParameter() == e2.getParameter()) && (e1.getRead() == e2.getRead()) && (e1.getTransferSize() == e2.getTransferSize());
}
SQLException nextException1 = exception1.getNextException();
SQLException nextException2 = exception2.getNextException();