|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jdbc.support.JdbcAccessor
Base class for JdbcTemplate and other JDBC-accessing DAO helpers, defining common properties like DataSource and exception translator.
Not intended to be used directly. See JdbcTemplate.
JdbcTemplate
Field Summary | |
protected Log |
logger
|
Constructor Summary | |
JdbcAccessor()
|
Method Summary | |
void |
afterPropertiesSet()
Eagerly initialize the exception translator, creating a default one for the specified DataSource if none set. |
DataSource |
getDataSource()
Return the DataSource used by this template. |
SQLExceptionTranslator |
getExceptionTranslator()
Return the exception translator for this instance. |
boolean |
isLazyInit()
Return whether to lazily initialize the SQLExceptionTranslator for this template. |
void |
setDataSource(DataSource dataSource)
Set the JDBC DataSource to obtain connections from. |
void |
setExceptionTranslator(SQLExceptionTranslator exceptionTranslator)
Set the exception translator for this instance. |
void |
setLazyInit(boolean lazyInit)
Set whether to lazily initialize the SQLExceptionTranslator for this template. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final Log logger
Constructor Detail |
public JdbcAccessor()
Method Detail |
public void setDataSource(DataSource dataSource)
public DataSource getDataSource()
public void setExceptionTranslator(SQLExceptionTranslator exceptionTranslator)
If no custom translator is provided, a default is used which examines the SQLException's vendor-specific error code.
exceptionTranslator
- exception translatorSQLErrorCodeSQLExceptionTranslator
,
SQLStateSQLExceptionTranslator
public SQLExceptionTranslator getExceptionTranslator()
Creates a default one for the specified DataSource if none set.
public void setLazyInit(boolean lazyInit)
afterPropertiesSet
is called.
getExceptionTranslator()
,
afterPropertiesSet()
public boolean isLazyInit()
public void afterPropertiesSet()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |