public class DelegatingDataSource extends ObjectSE implements DataSourceSE, InitializingBean
DataSource
SE に委譲する JDBC DataSource
SE 実装。 このクラスはサブクラス化されることを意図しており、サブクラスは、単にターゲット DataSource に委譲するべきではないメソッド(getConnection()
など)のみをオーバーライドします。
getConnection()
コンストラクターと説明 |
---|
DelegatingDataSource() 新しい DelegatingDataSource を作成します。 |
DelegatingDataSource(DataSourceSE targetDataSource) 新しい DelegatingDataSource を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
void | afterPropertiesSet() |
ConnectionSE | getConnection() |
ConnectionSE | getConnection(StringSE username, StringSE password) |
int | getLoginTimeout() |
PrintWriterSE | getLogWriter() |
LoggerSE | getParentLogger() |
DataSourceSE | getTargetDataSource() この DataSource が委譲するターゲット DataSource を返します。 |
boolean | isWrapperFor(ClassSE<?> iface) |
protected DataSourceSE | obtainTargetDataSource() 実際に使用するためにターゲット DataSource を取得します(決して null ではありません)。 |
void | setLoginTimeout(int seconds) |
void | setLogWriter(PrintWriterSE out) |
void | setTargetDataSource(DataSourceSE targetDataSource) この DataSource が委譲するターゲット DataSource を設定します。 |
<T> T | unwrap(ClassSE<T> iface) |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public DelegatingDataSource()
public DelegatingDataSource(DataSourceSE targetDataSource)
targetDataSource
- ターゲット DataSourcepublic void setTargetDataSource(@Nullable DataSourceSE targetDataSource)
@Nullable public DataSourceSE getTargetDataSource()
protected DataSourceSE obtainTargetDataSource()
DataSource
を取得します(決して null
ではありません)。public void afterPropertiesSet()
InitializingBean
BeanFactoryAware
、ApplicationContextAware
などを満たした後、包含 BeanFactory
によって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
InitializingBean
の afterPropertiesSet
public ConnectionSE getConnection() throws SQLExceptionSE
DataSourceSE
の getConnectionSE
SQLExceptionSE
public ConnectionSE getConnection(StringSE username, StringSE password) throws SQLExceptionSE
DataSourceSE
の getConnectionSE
SQLExceptionSE
public PrintWriterSE getLogWriter() throws SQLExceptionSE
CommonDataSourceSE
の getLogWriterSE
SQLExceptionSE
public void setLogWriter(PrintWriterSE out) throws SQLExceptionSE
CommonDataSourceSE
の setLogWriterSE
SQLExceptionSE
public int getLoginTimeout() throws SQLExceptionSE
CommonDataSourceSE
の getLoginTimeoutSE
SQLExceptionSE
public void setLoginTimeout(int seconds) throws SQLExceptionSE
CommonDataSourceSE
の setLoginTimeoutSE
SQLExceptionSE
public <T> T unwrap(ClassSE<T> iface) throws SQLExceptionSE
WrapperSE
の unwrapSE
SQLExceptionSE
public boolean isWrapperFor(ClassSE<?> iface) throws SQLExceptionSE
WrapperSE
の isWrapperForSE
SQLExceptionSE
public LoggerSE getParentLogger()
CommonDataSourceSE
の getParentLoggerSE