|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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()
Constructor Summary | |
---|---|
DelegatingDataSource()
Create a new DelegatingDataSource. |
|
DelegatingDataSource(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). |
Connection |
getConnection()
|
Connection |
getConnection(String username,
String password)
|
int |
getLoginTimeout()
|
PrintWriter |
getLogWriter()
|
DataSource |
getTargetDataSource()
Return the target DataSource that this DataSource should delegate to. |
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(PrintWriter out)
|
void |
setTargetDataSource(DataSource targetDataSource)
Set the target DataSource that this DataSource should delegate to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DelegatingDataSource()
setTargetDataSource(javax.sql.DataSource)
public DelegatingDataSource(DataSource targetDataSource)
targetDataSource
- the target DataSourceMethod Detail |
---|
public final void setTargetDataSource(DataSource targetDataSource)
public 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 Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface DataSource
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface DataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface DataSource
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface DataSource
SQLException
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |