public abstract class EasyJdbcAccessor extends Object implements org.springframework.beans.factory.InitializingBean
| 构造器和说明 |
|---|
EasyJdbcAccessor() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
DataSource |
getDataSource()
Return the DataSource used by this template.
|
String |
getDialectName() |
protected org.springframework.jdbc.support.SQLExceptionTranslator |
getExceptionTranslator()
Return the exception translator for this instance.
|
JdbcBuilder |
getJdbcBuilder() |
org.springframework.jdbc.core.JdbcTemplate |
getJdbcTemplate()
获取jdbcTemplate
|
void |
interfaceClass(String interfaceClass) |
protected boolean |
isLazyInit()
Return whether to lazily initialize the SQLExceptionTranslator for this accessor.
|
protected void |
setDatabaseProductName(String dbName)
Specify the database product name for the DataSource that this accessor uses.
|
void |
setDataSource(DataSource dataSource)
Set the JDBC DataSource to obtain connections from.
|
void |
setDialectName(String dialectName) |
protected void |
setExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator exceptionTranslator)
Set the exception translator for this instance.
|
protected void |
setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) |
protected <T> void |
setJdbcTemplate(LambdaSupplier<T> jdbcTemplate) |
protected void |
setLazyInit(boolean lazyInit)
Set whether to lazily initialize the SQLExceptionTranslator for this accessor,
on first encounter of a SQLException.
|
boolean |
showSQL(boolean showSQL) |
boolean |
useLocalCache(boolean useLocalCache) |
public void setDataSource(DataSource dataSource)
public DataSource getDataSource()
protected void setDatabaseProductName(String dbName)
dbName - the database product name that identifies the error codes entrySQLErrorCodeSQLExceptionTranslator.setDatabaseProductName(java.lang.String),
DatabaseMetaData.getDatabaseProductName()protected void setExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator exceptionTranslator)
If no custom translator is provided, a default
SQLErrorCodeSQLExceptionTranslator is used
which examines the SQLException's vendor-specific error code.
SQLErrorCodeSQLExceptionTranslator,
SQLStateSQLExceptionTranslatorprotected org.springframework.jdbc.support.SQLExceptionTranslator getExceptionTranslator()
Creates a default SQLErrorCodeSQLExceptionTranslator
for the specified DataSource if none set, or a
SQLStateSQLExceptionTranslator in case of no DataSource.
getDataSource()protected void setLazyInit(boolean lazyInit)
Early initialization just applies if afterPropertiesSet() is called.
protected boolean isLazyInit()
getExceptionTranslator()public void afterPropertiesSet()
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanpublic String getDialectName()
public void setDialectName(String dialectName)
protected void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
protected <T> void setJdbcTemplate(LambdaSupplier<T> jdbcTemplate)
public JdbcBuilder getJdbcBuilder()
public org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate()
public boolean showSQL(boolean showSQL)
public boolean useLocalCache(boolean useLocalCache)
public void interfaceClass(String interfaceClass)
Copyright © 2020. All rights reserved.