类 CustomSQLExceptionTranslatorRegistry
- java.lang.Object
- org.springframework.jdbc.support.CustomSQLExceptionTranslatorRegistry
public class CustomSQLExceptionTranslatorRegistry extends Object
Registry for customSQLExceptionTranslator
instances associated with specific databases allowing for overriding translation based on values contained in the configuration file named "sql-error-codes.xml".- 从以下版本开始:
- 3.1.1
- 作者:
- Thomas Risberg
- 另请参阅:
SQLErrorCodesFactory
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 SQLExceptionTranslator
findTranslatorForDatabase(String dbName)
Find a custom translator for the specified database.static CustomSQLExceptionTranslatorRegistry
getInstance()
Return the singleton instance.void
registerTranslator(String dbName, SQLExceptionTranslator translator)
Register a new custom translator for the specified database name.
方法详细资料
getInstance
public static CustomSQLExceptionTranslatorRegistry getInstance()
Return the singleton instance.
registerTranslator
public void registerTranslator(String dbName, SQLExceptionTranslator translator)
Register a new custom translator for the specified database name.- 参数:
dbName
- the database nametranslator
- the custom translator
findTranslatorForDatabase
public SQLExceptionTranslator findTranslatorForDatabase(String dbName)
Find a custom translator for the specified database.- 参数:
dbName
- the database name- 返回:
- the custom translator, or
null
if none found