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.
Parameters: task - readable text describing the task being attempted Parameters: sql - SQL query or update that caused the problem (may be null) Parameters: ex - the offending SQLException the DataAccessException, wrapping the SQLException See Also:org.springframework.dao.DataAccessException.getRootCause