org.springframework.jdbc.support.SQLExceptionTranslator instances associated with
specific databases allowing for overriding translation based on values contained in the configuration file
named "sql-error-codes.xml".
SQLErrorCodesFactory
| Modifier and Type | Field and Description |
|---|---|
| private static final CustomSQLExceptionTranslatorRegistry | instance
Keep track of a single instance so we can return it to classes that request it. |
| private static final Log | |
| private final Map | translatorMap
Map registry to hold custom translators specific databases. |
| Access | Constructor and Description |
|---|---|
| private | CustomSQLExceptionTranslatorRegistry()
Create a new instance of the |
| Modifier and Type | Method and Description |
|---|---|
| public SQLExceptionTranslator | Returns: the custom translator, ornull if none foundthe database name dbName)Find a custom translator for the specified database. |
| public static CustomSQLExceptionTranslatorRegistry | |
| public void | registerTranslator(String
the database name dbName, SQLExceptionTranslator the custom translator translator)Register a new custom translator for the specified database name. |
| instance | back to summary |
|---|---|
| private static final CustomSQLExceptionTranslatorRegistry instance Keep track of a single instance so we can return it to classes that request it. | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| translatorMap | back to summary |
|---|---|
| private final Map<String, SQLExceptionTranslator> translatorMap Map registry to hold custom translators specific databases.
Key is the database product name as defined in the
| |
| CustomSQLExceptionTranslatorRegistry | back to summary |
|---|---|
| private CustomSQLExceptionTranslatorRegistry() Create a new instance of the Not public to enforce Singleton design pattern. | |
| findTranslatorForDatabase | back to summary |
|---|---|
| public SQLExceptionTranslator findTranslatorForDatabase(String dbName) Find a custom translator for the specified database.
| |
| getInstance | back to summary |
|---|---|
| public static CustomSQLExceptionTranslatorRegistry getInstance() Return the singleton instance. | |
| registerTranslator | back to summary |
|---|---|
| public void registerTranslator(String dbName, SQLExceptionTranslator translator) Register a new custom translator for the specified database name.
| |