Class JdbcDaoSupport
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.jdbc.core.support.JdbcDaoSupport
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
NamedParameterJdbcDaoSupport
@Deprecated(since="7.0",
forRemoval=true)
public abstract class JdbcDaoSupport
extends org.springframework.dao.support.DaoSupport
Deprecated, for removal: This API element is subject to removal in a future version.
Convenient superclass for JDBC-based data access objects.
Requires a DataSource to be set, providing a
JdbcTemplate based on it to
subclasses through the getJdbcTemplate() method.
This base class is mainly intended for JdbcTemplate usage but can
also be used when working with a Connection directly or when using
org.springframework.jdbc.object operation objects.
- Since:
- 28.07.2003
- Author:
- Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated, for removal: This API element is subject to removal in a future version.protected JdbcTemplatecreateJdbcTemplate(DataSource dataSource) Deprecated, for removal: This API element is subject to removal in a future version.Create a JdbcTemplate for the given DataSource.protected final ConnectionDeprecated, for removal: This API element is subject to removal in a future version.Get a JDBC Connection, either from the current transaction or a new one.final @Nullable DataSourceDeprecated, for removal: This API element is subject to removal in a future version.Return the JDBC DataSource used by this DAO.protected final SQLExceptionTranslatorDeprecated, for removal: This API element is subject to removal in a future version.Return the SQLExceptionTranslator of this DAO's JdbcTemplate, for translating SQLExceptions in custom JDBC access code.final @Nullable JdbcTemplateDeprecated, for removal: This API element is subject to removal in a future version.Return the JdbcTemplate for this DAO, pre-initialized with the DataSource or set explicitly.protected voidDeprecated, for removal: This API element is subject to removal in a future version.Initialize the template-based configuration of this DAO.protected final voidDeprecated, for removal: This API element is subject to removal in a future version.Close the given JDBC Connection, created via this DAO's DataSource, if it isn't bound to the thread.final voidsetDataSource(DataSource dataSource) Deprecated, for removal: This API element is subject to removal in a future version.Set the JDBC DataSource to be used by this DAO.final voidsetJdbcTemplate(@Nullable JdbcTemplate jdbcTemplate) Deprecated, for removal: This API element is subject to removal in a future version.Set the JdbcTemplate for this DAO explicitly, as an alternative to specifying a DataSource.Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
-
Constructor Details
-
JdbcDaoSupport
public JdbcDaoSupport()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
setDataSource
Deprecated, for removal: This API element is subject to removal in a future version.Set the JDBC DataSource to be used by this DAO. -
createJdbcTemplate
Deprecated, for removal: This API element is subject to removal in a future version.Create a JdbcTemplate for the given DataSource. Only invoked if populating the DAO with a DataSource reference!Can be overridden in subclasses to provide a JdbcTemplate instance with different configuration, or a custom JdbcTemplate subclass.
- Parameters:
dataSource- the JDBC DataSource to create a JdbcTemplate for- Returns:
- the new JdbcTemplate instance
- See Also:
-
getDataSource
Deprecated, for removal: This API element is subject to removal in a future version.Return the JDBC DataSource used by this DAO. -
setJdbcTemplate
Deprecated, for removal: This API element is subject to removal in a future version.Set the JdbcTemplate for this DAO explicitly, as an alternative to specifying a DataSource. -
getJdbcTemplate
Deprecated, for removal: This API element is subject to removal in a future version.Return the JdbcTemplate for this DAO, pre-initialized with the DataSource or set explicitly. -
initTemplateConfig
protected void initTemplateConfig()Deprecated, for removal: This API element is subject to removal in a future version.Initialize the template-based configuration of this DAO. Called after a new JdbcTemplate has been set, either directly or through a DataSource.This implementation is empty. Subclasses may override this to configure further objects based on the JdbcTemplate.
- See Also:
-
checkDaoConfig
protected void checkDaoConfig()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
checkDaoConfigin classorg.springframework.dao.support.DaoSupport
-
getExceptionTranslator
Deprecated, for removal: This API element is subject to removal in a future version.Return the SQLExceptionTranslator of this DAO's JdbcTemplate, for translating SQLExceptions in custom JDBC access code.- See Also:
-
getConnection
Deprecated, for removal: This API element is subject to removal in a future version.Get a JDBC Connection, either from the current transaction or a new one.- Returns:
- the JDBC Connection
- Throws:
CannotGetJdbcConnectionException- if the attempt to get a Connection failed- See Also:
-
releaseConnection
Deprecated, for removal: This API element is subject to removal in a future version.Close the given JDBC Connection, created via this DAO's DataSource, if it isn't bound to the thread.- Parameters:
con- the Connection to close- See Also:
-
JdbcTemplateorJdbcClient