List of usage examples for org.springframework.jdbc.support CustomSQLExceptionTranslatorRegistry getInstance
public static CustomSQLExceptionTranslatorRegistry getInstance()
From source file:org.springframework.jdbc.support.SQLErrorCodesFactory.java
/** * Check the {@link CustomSQLExceptionTranslatorRegistry} for any entries. *///w w w. j ava2 s . c om private void checkCustomTranslatorRegistry(String databaseName, SQLErrorCodes errorCodes) { SQLExceptionTranslator customTranslator = CustomSQLExceptionTranslatorRegistry.getInstance() .findTranslatorForDatabase(databaseName); if (customTranslator != null) { if (errorCodes.getCustomSqlExceptionTranslator() != null && logger.isWarnEnabled()) { logger.warn("Overriding already defined custom translator '" + errorCodes.getCustomSqlExceptionTranslator().getClass().getSimpleName() + " with '" + customTranslator.getClass().getSimpleName() + "' found in the CustomSQLExceptionTranslatorRegistry for database '" + databaseName + "'"); } else if (logger.isInfoEnabled()) { logger.info("Using custom translator '" + customTranslator.getClass().getSimpleName() + "' found in the CustomSQLExceptionTranslatorRegistry for database '" + databaseName + "'"); } errorCodes.setCustomSqlExceptionTranslator(customTranslator); } }