类 SQLExceptionSubclassTranslator
- java.lang.Object
- org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
- org.springframework.jdbc.support.SQLExceptionSubclassTranslator
- 所有已实现的接口:
SQLExceptionTranslator
public class SQLExceptionSubclassTranslator extends AbstractFallbackSQLExceptionTranslator
SQLExceptionTranslator
implementation which analyzes the specificSQLException
subclass thrown by the JDBC driver.Falls back to a standard
SQLStateSQLExceptionTranslator
if the JDBC driver does not actually expose JDBC 4 compliantSQLException
subclasses.- 从以下版本开始:
- 2.5
- 作者:
- Thomas Risberg, Juergen Hoeller
- 另请参阅:
SQLTransientException
,SQLTransientException
,SQLRecoverableException
字段概要
从类继承的字段 org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
logger
构造器概要
构造器 构造器 说明 SQLExceptionSubclassTranslator()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected DataAccessException
doTranslate(String task, String sql, SQLException ex)
Template method for actually translating the given exception.从类继承的方法 org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
buildMessage, getFallbackTranslator, setFallbackTranslator, translate
构造器详细资料
SQLExceptionSubclassTranslator
public SQLExceptionSubclassTranslator()
方法详细资料
doTranslate
protected DataAccessException doTranslate(String task, String sql, SQLException ex)
Template method for actually translating the given exception.The passed-in arguments will have been pre-checked. Furthermore, this method is allowed to return
null
to indicate that no exception match has been found and that fallback translation should kick in.- 指定者:
doTranslate
在类中AbstractFallbackSQLExceptionTranslator
- 参数:
task
- readable text describing the task being attemptedsql
- the SQL query or update that caused the problem (if known)ex
- the offendingSQLException
- 返回:
- the DataAccessException, wrapping the
SQLException
; ornull
if no exception match found