站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

SQLExceptionTranslator (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.jdbc.support
Interface SQLExceptionTranslator

All Known Implementing Classes:
SQLErrorCodeSQLExceptionTranslator, SQLStateSQLExceptionTranslator

public interface SQLExceptionTranslator

Interface to be implemented by classes that can translate between SQLExceptions and our data access strategy-agnostic org.springframework.dao.DataAccessException.

Implementations can be generic (for example, using SQLState codes for JDBC) or proprietary (for example, using Oracle error codes) for greater precision.

Author:
Rod Johnson
See Also:
DataAccessException

Method Summary
 DataAccessException translate(String task, String sql, SQLException sqlEx)
          Translate the given SQL exception into a generic data access exception.
 

Method Detail

translate

DataAccessException translate(String task,
                              String sql,
                              SQLException sqlEx)
Translate the given SQL exception into a generic data access exception.

Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem. May be null.
sqlEx - the offending SQLException
Returns:
the DataAccessException to throw


Copyright (c) 2002-2007 The Spring Framework Project.