All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.usf.inspect.jdbc.DataSourceWrapper Maven / Gradle / Ivy

package org.usf.inspect.jdbc;

import static org.usf.inspect.jdbc.DatabaseStageTracker.connect;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

import lombok.RequiredArgsConstructor;
import lombok.experimental.Delegate;

/**
 * 
 * @author u$f
 *
 */
@RequiredArgsConstructor
public final class DataSourceWrapper implements DataSource {
	
	@Delegate
	private final DataSource ds;

	@Override
	public Connection getConnection() throws SQLException {
		return connect(ds::getConnection);
	}

	@Override
	public Connection getConnection(String username, String password) throws SQLException {
		return connect(()-> ds.getConnection(username, password));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy