Implementation of SQLExceptionTranslator that analyzes vendor-specific error codes. More precise than an implementation based on SQL state, but vendor-specific.
This class applies the following matching rules:
- Try custom translation implemented by any subclass. Note that this class is concrete and is typically used itself, in which case this rule doesn't apply.
- Use subclass translator. Java 6 introduces its own SQLException hierarchy and in a Java 6 or later environment we will attempt a translation based on the subclass of the exception.
- Apply error code matching. Error codes are obtained from the SQLErrorCodesFactory by default. This factory loads a "sql-error-codes.xml" file from the class path, defining error code mappings for database names from database metadata.
- Fallback to a fallback translator. SQLStateSQLExceptionTranslator is the default fallback translator, analyzing the exception's SQL state only.
The configuration file named "sql-error-codes.xml" is by default read from this package. It can be overridden through a file of the same name in the root of the class path (e.g. in the "/WEB-INF/classes" directory).
@author Rod Johnson
@author Thomas Risberg
@author Juergen Hoeller
@see SQLErrorCodesFactory
@see SQLStateSQLExceptionTranslator