org.springframework.jdbc.support
Class SQLStateSQLExceptionTranslator

java.lang.Object
  extended byorg.springframework.jdbc.support.SQLStateSQLExceptionTranslator
All Implemented Interfaces:
SQLExceptionTranslator

public class SQLStateSQLExceptionTranslator
extends java.lang.Object
implements SQLExceptionTranslator

Implementation of SQLExceptionTranslator that uses the SQLState code in the SQLException. Can't diagnose all problems, but is portable between databases.

Author:
Rod Johnson
See Also:
SQLException.getSQLState()

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
SQLStateSQLExceptionTranslator()
           
 
Method Summary
 DataAccessException translate(java.lang.String task, java.lang.String sql, java.sql.SQLException sqlex)
          Translate the given SQL exception into a generic data access exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

SQLStateSQLExceptionTranslator

public SQLStateSQLExceptionTranslator()
Method Detail

translate

public DataAccessException translate(java.lang.String task,
                                     java.lang.String sql,
                                     java.sql.SQLException sqlex)
Description copied from interface: SQLExceptionTranslator
Translate the given SQL exception into a generic data access exception.

Specified by:
translate in interface SQLExceptionTranslator
Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem. May be null.
sqlex - SQLException encountered by JDBC implementation


Copyright (C) 2003-2004 The Spring Framework Project.