package eu.dnetlib.dlms.jdbc.server;

import java.sql.SQLException;

import javax.sql.DataSource;

import eu.dnetlib.miscutils.factory.Factory;

public class ConnectionWrapperFactory implements Factory<ConnectionWrapper> {

	private DataSource dataSource; 
	
	public ConnectionWrapper newInstance() {
		try {
			return new ConnectionWrapper(dataSource);
		} catch (SQLException e) {
			throw new IllegalStateException("cannot create connection", e);
		}
	}

	public DataSource getDataSource() {
		return dataSource;
	}

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}

}
