org.springframework.jdbc.support
Class JdbcAccessor

java.lang.Object
  extended byorg.springframework.jdbc.support.JdbcAccessor
Direct Known Subclasses:
JdbcTemplate, SqlMapClientTemplate, SqlMapTemplate

public class JdbcAccessor
extends java.lang.Object

Base class for JdbcTemplate and other JDBC-accessing DAO helpers, defining common properties like exception translator.

Not intended to be used directly. See JdbcTemplate.

Since:
28.11.2003
Author:
Juergen Hoeller
See Also:
JdbcTemplate

Constructor Summary
JdbcAccessor()
           
 
Method Summary
 void afterPropertiesSet()
          Eagerly initialize the exception translator, creating a default one for the specified DataSource if none set.
 javax.sql.DataSource getDataSource()
          Return the DataSource used by this template.
 SQLExceptionTranslator getExceptionTranslator()
          Return the exception translator for this instance.
 void setDataSource(javax.sql.DataSource dataSource)
          Set the JDBC DataSource to obtain connections from.
 void setExceptionTranslator(SQLExceptionTranslator exceptionTranslator)
          Set the exception translator for this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcAccessor

public JdbcAccessor()
Method Detail

setDataSource

public void setDataSource(javax.sql.DataSource dataSource)
Set the JDBC DataSource to obtain connections from.


getDataSource

public javax.sql.DataSource getDataSource()
Return the DataSource used by this template.


setExceptionTranslator

public void setExceptionTranslator(SQLExceptionTranslator exceptionTranslator)
Set the exception translator for this instance. If no custom translator is provided, a default is used which examines the SQLException's vendor-specific error code.

Parameters:
exceptionTranslator - exception translator
See Also:
SQLErrorCodeSQLExceptionTranslator, SQLStateSQLExceptionTranslator

getExceptionTranslator

public SQLExceptionTranslator getExceptionTranslator()
Return the exception translator for this instance. Creates a default one for the specified DataSource if none set.


afterPropertiesSet

public void afterPropertiesSet()
Eagerly initialize the exception translator, creating a default one for the specified DataSource if none set.



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