public class DataSourceWrapper extends Object implements DataSource
Constructor and Description |
---|
DataSourceWrapper(DataSource dataSource) |
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
DataSource |
getWrappedDataSource() |
boolean |
isWrapperFor(Class<?> clazz) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
void |
setWrappedDataSource(DataSource wrappedDataSource) |
<T> T |
unwrap(Class<T> clazz) |
public DataSourceWrapper(DataSource dataSource)
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 int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public Logger getParentLogger()
getParentLogger
in interface CommonDataSource
public DataSource getWrappedDataSource()
public boolean isWrapperFor(Class<?> clazz)
isWrapperFor
in interface Wrapper
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public void setWrappedDataSource(DataSource wrappedDataSource)
public <T> T unwrap(Class<T> clazz) throws SQLException
unwrap
in interface Wrapper
SQLException