public class DataSourceWrapper extends Object implements DataSource
DataSource except for the getConnection() method,
 which delegates to DataSource#getConnection(String, String) with the username and password
 which are given on construction.| Constructor and Description | 
|---|
| DataSourceWrapper(DataSource dataSource,
                 String username,
                 String password) | 
| Modifier and Type | Method and Description | 
|---|---|
| Connection | getConnection() | 
| Connection | getConnection(String username,
             String password) | 
| int | getLoginTimeout() | 
| PrintWriter | getLogWriter() | 
| Logger | getParentLogger()Unsupported Java 7 method. | 
| boolean | isWrapperFor(Class<?> arg0)Java 6 method. | 
| void | setLoginTimeout(int seconds) | 
| void | setLogWriter(PrintWriter out) | 
| <T> T | unwrap(Class<T> arg0)Java 6 method. | 
public DataSourceWrapper(DataSource dataSource, String username, String password)
dataSource - the DataSource to wrapusername - the username to usepassword - the password to usepublic boolean isWrapperFor(Class<?> arg0) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic <T> T unwrap(Class<T> arg0) throws SQLException
unwrap in interface WrapperSQLExceptionpublic Logger getParentLogger()
getParentLogger in interface CommonDataSourcepublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic int getLoginTimeout()
                    throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
                     throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.