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

org.javasimon.jdbcx4.SimonConnectionPoolDataSource Maven / Gradle / Ivy

There is a newer version: 4.2.0
Show newest version
package org.javasimon.jdbcx4;

import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
import javax.sql.ConnectionPoolDataSource;
import javax.sql.PooledConnection;

/**
 * Wrapper class for real ConnectionPoolDataSource implementation, produces pooled
 * {@link javax.sql.PooledConnection} object.
 * 

* See the {@link SimonDataSource} for more information. * * @author Radovan Sninsky * @author Richard "Virgo" Richter * @since 2.4 */ public final class SimonConnectionPoolDataSource extends AbstractSimonDataSource implements ConnectionPoolDataSource { private ConnectionPoolDataSource ds; private ConnectionPoolDataSource datasource() throws SQLException { if (ds == null) { ds = createDataSource(ConnectionPoolDataSource.class); } return ds; } @Override public PooledConnection getPooledConnection() throws SQLException { return new SimonPooledConnection(datasource().getPooledConnection(), getPrefix()); } @Override public PooledConnection getPooledConnection(String user, String password) throws SQLException { return new SimonPooledConnection(datasource().getPooledConnection(user, password), getPrefix()); } @Override protected String doGetRealDataSourceClassName() { return configuration.getRealConnectionPoolDataSourceName(); } @Override public Logger getParentLogger() throws SQLFeatureNotSupportedException { return ds.getParentLogger(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy