abstract class JdbcAccessor : InitializingBean
Base class for org.springframework.jdbc.core.JdbcTemplate and other JDBC-accessing DAO helpers, defining common properties such as DataSource and exception translator.
Not intended to be used directly. See org.springframework.jdbc.core.JdbcTemplate.
Author
Juergen Hoeller
Since
28.11.2003
See Also
org.springframework.jdbc.core.JdbcTemplate
JdbcAccessor()
Base class for org.springframework.jdbc.core.JdbcTemplate and other JDBC-accessing DAO helpers, defining common properties such as DataSource and exception translator. Not intended to be used directly. See org.springframework.jdbc.core.JdbcTemplate. |
open fun afterPropertiesSet(): Unit
Eagerly initialize the exception translator, if demanded, creating a default one for the specified DataSource if none set. |
|
open fun getDataSource(): DataSource
Return the DataSource used by this template. |
|
open fun getExceptionTranslator(): SQLExceptionTranslator
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. |
|
open fun isLazyInit(): Boolean
Return whether to lazily initialize the SQLExceptionTranslator for this accessor. |
|
open fun setDataSource(dataSource: DataSource): Unit
Set the JDBC DataSource to obtain connections from. |
|
open fun setDatabaseProductName(dbName: String): Unit
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. |
|
open fun setExceptionTranslator(exceptionTranslator: SQLExceptionTranslator): Unit
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. |
|
open fun setLazyInit(lazyInit: Boolean): Unit
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 |