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

SQLExceptionTranslator (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.jdbc.support
Interface SQLExceptionTranslator

All Known Implementing Classes:
SQLErrorCodeSQLExceptionTranslator, SQLStateSQLExceptionTranslator

public interface SQLExceptionTranslator

Strategy interface for translating between SQLExceptions and Spring's data access strategy-agnostic DataAccessException hierarchy.

Implementations can be generic (for example, using SQLState codes for JDBC) or wholly 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 ex)
          Translate the given SQLException into a generic DataAccessException.
 

Method Detail

translate

DataAccessException translate(String task,
                              String sql,
                              SQLException ex)
Translate the given SQLException into a generic DataAccessException.

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 to throw

The Spring Framework

Copyright © 2002-2007 The Spring Framework.