translate

open override fun translate(task: String, sql: String?, ex: SQLException): DataAccessException?

Translates the given SQLException into a generic DataAccessException.

The cause chain is searched by findOctaviusCause, which finds both shapes a driver failure reaches Spring in: wrapped by the JDBC surface, or bare, the way a pool records one it could not open a connection through. Either yields an OctaviusDataAccessException carrying the original, so a driver failure keeps its type instead of collapsing into a generic one.

If nothing Octavius-shaped is found, it falls back to the default SQLStateSQLExceptionTranslator.

Return

the translated DataAccessException, or null if it could not be translated

Parameters

task

readable text describing the task being attempted

sql

the SQL query or update that caused the problem (may be null)

ex

the offending SQLException