Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DataSourceWrapper implements DataSource {
- private final DataSource dataSource;
- private final String username;
- private final String password;
- public DataSourceWrapper(DataSource dataSource, String username, String password) {
- this.dataSource = dataSource;
- this.username = username;
- this.password = password;
- }
- public Connection getConnection() throws SQLException {
- return dataSource.getConnection(username, password);
- }
- public Connection getConnection(String username, String password)
- throws SQLException {
- return dataSource.getConnection(username, password);
- }
- public PrintWriter getLogWriter() throws SQLException {
- return dataSource.getLogWriter();
- }
- public int getLoginTimeout() throws SQLException {
- return dataSource.getLoginTimeout();
- }
- public void setLogWriter(PrintWriter out) throws SQLException {
- dataSource.setLogWriter(out);
- }
- public void setLoginTimeout(int seconds) throws SQLException {
- dataSource.setLoginTimeout(seconds);
- }
- }
Add Comment
Please, Sign In to add comment