|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.jdbc.datasource.DelegatingDataSource
public class DelegatingDataSource
JDBC DataSource
implementation that delegates all calls
to a given target DataSource
.
This class is meant to be subclassed, with subclasses overriding only
those methods (such as getConnection()
) that should not simply
delegate to the target DataSource.
getConnection()
Field Summary | |
---|---|
private javax.sql.DataSource |
targetDataSource
|
Constructor Summary | |
---|---|
DelegatingDataSource()
Create a new DelegatingDataSource. |
|
DelegatingDataSource(javax.sql.DataSource targetDataSource)
Create a new DelegatingDataSource. |
Method Summary | ||
---|---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware). |
|
java.sql.Connection |
getConnection()
|
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
|
|
int |
getLoginTimeout()
|
|
java.io.PrintWriter |
getLogWriter()
|
|
java.util.logging.Logger |
getParentLogger()
|
|
javax.sql.DataSource |
getTargetDataSource()
Return the target DataSource that this DataSource should delegate to. |
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
|
|
void |
setLoginTimeout(int seconds)
|
|
void |
setLogWriter(java.io.PrintWriter out)
|
|
void |
setTargetDataSource(javax.sql.DataSource targetDataSource)
Set the target DataSource that this DataSource should delegate to. |
|
|
unwrap(java.lang.Class<T> iface)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private javax.sql.DataSource targetDataSource
Constructor Detail |
---|
public DelegatingDataSource()
setTargetDataSource(javax.sql.DataSource)
public DelegatingDataSource(javax.sql.DataSource targetDataSource)
targetDataSource
- the target DataSourceMethod Detail |
---|
public void setTargetDataSource(javax.sql.DataSource targetDataSource)
public javax.sql.DataSource getTargetDataSource()
public void afterPropertiesSet()
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLoginTimeout(int seconds) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
public java.util.logging.Logger getParentLogger()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |