public class

SQLExceptionSubclassTranslator

extends AbstractFallbackSQLExceptionTranslator
java.lang.Object
   ↳ org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
     ↳ org.springframework.jdbc.support.SQLExceptionSubclassTranslator

Class Overview

SQLExceptionTranslator implementation which analyzes the specific java.sql.SQLException subclass thrown by the JDBC driver.

This is only available with JDBC 4.0 and later drivers when using Java 6 or later. Falls back to a standard SQLStateSQLExceptionTranslator if the JDBC driver does not actually expose JDBC 4 compliant SQLException subclasses.

See Also
  • java.sql.SQLTransientException
  • java.sql.SQLTransientException
  • java.sql.SQLRecoverableException

Summary

[Expand]
Inherited Fields
From class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
Public Constructors
SQLExceptionSubclassTranslator()
Protected Methods
DataAccessException doTranslate(String task, String sql, SQLException ex)
Template method for actually translating the given exception.
[Expand]
Inherited Methods
From class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
From class java.lang.Object
From interface org.springframework.jdbc.support.SQLExceptionTranslator

Public Constructors

public SQLExceptionSubclassTranslator ()

Protected Methods

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.

Parameters
task readable text describing the task being attempted
sql SQL query or update that caused the problem (may be null)
ex the offending SQLException
Returns
  • the DataAccessException, wrapping the SQLException; or null if no exception match found