List of usage examples for org.springframework.jdbc.support SQLErrorCodes setCustomSqlExceptionTranslator
public void setCustomSqlExceptionTranslator(@Nullable SQLExceptionTranslator customSqlExceptionTranslator)
From source file:org.springframework.jdbc.support.SQLErrorCodesFactory.java
/** * Check the {@link CustomSQLExceptionTranslatorRegistry} for any entries. *///from w w w.j a v a2 s .co m 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); } }