java.lang.Object | |
↳ | org.springframework.jdbc.support.JdbcAccessor |
Known Direct Subclasses |
Base class for JdbcTemplate
and
other JDBC-accessing DAO helpers, defining common properties such as
DataSource and exception translator.
Not intended to be used directly.
See JdbcTemplate
.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger | Logger available to subclasses |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Eagerly initialize the exception translator, if demanded,
creating a default one for the specified DataSource if none set.
| |||||||||||
Return the DataSource used by this template.
| |||||||||||
Return the exception translator for this instance.
| |||||||||||
Return whether to lazily initialize the SQLExceptionTranslator for this accessor.
| |||||||||||
Set the JDBC DataSource to obtain connections from.
| |||||||||||
Specify the database product name for the DataSource that this accessor uses.
| |||||||||||
Set the exception translator for this instance.
| |||||||||||
Set whether to lazily initialize the SQLExceptionTranslator for this accessor,
on first encounter of a SQLException.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
|
Logger available to subclasses
Eagerly initialize the exception translator, if demanded, creating a default one for the specified DataSource if none set.
Return the exception translator for this instance.
Creates a default SQLErrorCodeSQLExceptionTranslator
for the specified DataSource if none set, or a
SQLStateSQLExceptionTranslator
in case of no DataSource.
Return whether to lazily initialize the SQLExceptionTranslator for this accessor.
Set the JDBC DataSource to obtain connections from.
Specify the database product name for the DataSource that this accessor uses. This allows to initialize a SQLErrorCodeSQLExceptionTranslator without obtaining a Connection from the DataSource to get the metadata.
dbName | the database product name that identifies the error codes entry |
---|
Set the exception translator for this instance.
If no custom translator is provided, a default
SQLErrorCodeSQLExceptionTranslator
is used
which examines the SQLException's vendor-specific error code.
Set whether to lazily initialize the SQLExceptionTranslator for this accessor, on first encounter of a SQLException. Default is "true"; can be switched to "false" for initialization on startup.
Early initialization just applies if afterPropertiesSet()
is called.