The returned DataAccessException is supposed to contain the original SQLException
as root cause. However, client code may not generally rely on this due to DataAccessExceptions possibly being caused by other resource APIs as well. That said, a getRootCause() instanceof SQLException
check (and subsequent cast) is considered reliable when expecting JDBC-based access to have happened.
@param task readable text describing the task being attempted
@param sql SQL query or update that caused the problem (may be null
)
@param ex the offending SQLException
@return the DataAccessException, wrapping the SQLException
@see org.springframework.dao.DataAccessException#getRootCause()
|
|
|
|
|
|
|
|
|
|
|
|
|
|