2. DAO Support 2.1. Consistent Exception Hierarchy
Spring 提供了特定异常到自己异常类层次结构的转换。该类层次结构将 DataAccessException 作为根异常。
3. Data Access with JDBC 3.3. Using the JDBC Core Classes to Control Basic JDBC Processing and Error Handling 3.3.3. Using SQLExceptionTranslatorSQLExceptionTranslator 是一个接口,用于 SQLExceptions 和 Spring 的 DataAccessException 之间进行转换。
SQLErrorCodeSQLExceptionTranslator 是 SQLExceptionTranslator 默认的实现。此实现使用特定的供应商代码,比 SQLState 更精确。错误代码转换基于名为 SQLErrorCodes 的 JavaBean 类中保存的代码。此类由 SQLErrorCodesFactory 创建和填充,是基于 sql-error-codes.xml 的配置文件的内容创建的工厂。



