Package org.apache.commons.dbcp

Examples of org.apache.commons.dbcp.PoolableConnectionFactory


     * @param abandonedConfig abandoned connection tracking configuration (null if no tracking)
     * @throws SQLException if an error occurs creating the PoolableConnectionFactory
     */
    protected void createPoolableConnectionFactory(ConnectionFactory driverConnectionFactory,
            KeyedObjectPoolFactory statementPoolFactory, AbandonedConfig abandonedConfig) throws SQLException {
        PoolableConnectionFactory connectionFactory = null;
        try {
            connectionFactory =
                new PoolableManagedConnectionFactory((XAConnectionFactory) driverConnectionFactory,
                                              connectionPool,
                                              statementPoolFactory,
View Full Code Here


        //
        // Now we'll create the PoolableConnectionFactory, which wraps
        // the "real" Connections created by the ConnectionFactory with
        // the classes that implement the pooling functionality.
        //
        PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);

        //
        // Finally, we create the PoolingDriver itself...
        //
        PoolingDriver driver = new PoolingDriver();
View Full Code Here

        //
        // Now we'll create the PoolableConnectionFactory, which wraps
        // the "real" Connections created by the ConnectionFactory with
        // the classes that implement the pooling functionality.
        //
        PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);

        //
        // Finally, we create the PoolingDriver itself,
        // passing in the object pool we created.
        //
View Full Code Here

        }
        DriverConnectionFactory driverConnectionFactory =
            new DriverConnectionFactory(driver, url, connectionProperties);

        // Set up the poolable connection factory we will use
        PoolableConnectionFactory connectionFactory = null;
        try {
            connectionFactory =
                new PoolableConnectionFactory(driverConnectionFactory,
                                              connectionPool,
                                              null, // FIXME - stmtPoolFactory?
                                              validationQuery,
                                              defaultReadOnly,
                                              defaultAutoCommit,
View Full Code Here

        // a side effect of PoolableConnectionFactory constructor call is that newly
        // created factory object is assigned to "connectionPool", which is definitely a
        // very confusing part of DBCP - new object is not visibly assigned to anything,
        // still it is preserved...
        new PoolableConnectionFactory(
                factory,
                connectionPool,
                statementPool,
                validationQuery,
                defaultReadOnly ? Boolean.TRUE : Boolean.FALSE,
View Full Code Here

    connectionPool.setMaxActive(maxActive);

    statementPool = new GenericKeyedObjectPoolFactory(null);

    // Creating the factory instance automatically wires the connection pool
    new PoolableConnectionFactory(connFactory, connectionPool, statementPool,
        databaseType.getValidationQuery(), false, false,
        txIsolationLevel.getCode());

    dataSource = new PoolingDataSource(connectionPool);
View Full Code Here

    objectPool.setTestOnBorrow(false);
    objectPool.setTestOnReturn(false);
    objectPool.setTestWhileIdle(true);
    objectPool.setTimeBetweenEvictionRunsMillis(60 * 1000L);
    // Constructor actually sets itself as factory on pool
    new PoolableConnectionFactory(connectionFactory, objectPool, null, "SELECT 1", false, false);
    delegate = new PoolingDataSource(objectPool);
  }
View Full Code Here

        //
        // Now we'll create the PoolableConnectionFactory, which wraps
        // the "real" Connections created by the ConnectionFactory with
        // the classes that implement the pooling functionality.
        //
        PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);

        //
        // Finally, we create the PoolingDriver itself...
        //
        Class.forName("org.apache.commons.dbcp.PoolingDriver");
View Full Code Here

        //
        // Now we'll create the PoolableConnectionFactory, which wraps
        // the "real" Connections created by the ConnectionFactory with
        // the classes that implement the pooling functionality.
        //
        PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);

        //
        // Finally, we create the PoolingDriver itself,
        // passing in the object pool we created.
        //
View Full Code Here

        pool = new GenericObjectPool();
        pool.setMaxActive(getMaxActive());
        pool.setMaxWait(getMaxWait());

        // create the pool object factory
        PoolableConnectionFactory factory = new PoolableConnectionFactory(xaConnectionFactory, pool, null, "SELECT DUMMY FROM DUAL", true, true);
        pool.setFactory(factory);

        // finally create the datasource
        ds = new ManagedDataSource(pool, xaConnectionFactory.getTransactionRegistry());
        ds.setAccessToUnderlyingConnectionAllowed(true);
View Full Code Here

TOP

Related Classes of org.apache.commons.dbcp.PoolableConnectionFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.