/** * Creates the actual data source instance. This method only exists so * subclasses can replace the implementation class. * * @throws SQLException if unable to create a datasource instance */ protected void createDataSourceInstance() throws SQLException { PoolingDataSource pds = new PoolingDataSource(connectionPool); pds.setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed()); pds.setLogWriter(logWriter); dataSource = pds; }
DataSource createDataSource() { boolean connectionNoWrap = config.getBoolean(CONNECTION_NOWRAP, false); ObjectPool connectionPool = createConnectionPool(); PoolingDataSource dataSource = new PoolingDataSource(connectionPool); dataSource.setAccessToUnderlyingConnectionAllowed(connectionNoWrap); return dataSource; }
protected void createDataSourceInstance() throws SQLException { PoolingDataSource pds = new ManagedDataSource(connectionPool, transactionRegistry); pds.setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed()); pds.setLogWriter(logWriter); dataSource = pds; }
/** * Creates the actual data source instance. This method only exists so * subclasses can replace the implementation class. * * @throws SQLException if unable to create a datasource instance */ protected void createDataSourceInstance() throws SQLException { PoolingDataSource pds = new PoolingDataSource(connectionPool); pds.setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed()); pds.setLogWriter(logWriter); dataSource = pds; }
protected void createDataSourceInstance() throws SQLException { PoolingDataSource pds = new ManagedDataSource(connectionPool, transactionRegistry); pds.setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed()); pds.setLogWriter(logWriter); dataSource = pds; }
poolingDataSource.setAccessToUnderlyingConnectionAllowed( Boolean.parseBoolean( attributes .get( IDBDatasourceService.ACCESS_TO_UNDERLYING_CONNECTION_ALLOWED ) ) );
/** * Creates a new {@link ConnectionPool} instance. * * @param id * @param connectURI * @param user * @param password * @param readOnly * @param minIdle * @param maxActive */ public ConnectionPool( String id, String connectURI, String user, String password, boolean readOnly, int minIdle, int maxActive ) { this.id = id; pool = new GenericObjectPool<Connection>( null ); pool.setMinIdle( minIdle ); pool.setMaxActive( maxActive ); ConnectionFactory connectionFactory = new DriverManagerConnectionFactory( connectURI, user, password ); // TODO make this configurable new PoolableConnectionFactory( connectionFactory, pool, null, null, readOnly, true ); ds = new PoolingDataSource( pool ); // needed, so users can retrieve the underlying connection from pooled // connections, e.g. to access the // LargeObjectManager from a PGConnection ds.setAccessToUnderlyingConnectionAllowed( true ); }
dataSource.setAccessToUnderlyingConnectionAllowed(booleanProperty( properties, "accessToUnderlyingConnectionAllowed",
((PoolingDataSource) dataSource).setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed()); dataSource.setLogWriter(logWriter);
((PoolingDataSource) dataSource).setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed()); dataSource.setLogWriter(logWriter);
((PoolingDataSource) dataSource).setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed()); dataSource.setLogWriter(logWriter);