Package org.apache.commons.dbcp

Examples of org.apache.commons.dbcp.PoolingDataSource


           
            ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURI, user, password);
           
            dsConnectionFactory = new PoolableConnectionFactory(connectionFactory, connectionPool, null, null, false, true);
           
            dataSource = new PoolingDataSource(connectionPool);           
           
            log.info("DBCPCDatasourceComponent successfuly started!");
        }
        catch (Throwable e)
        {
View Full Code Here


    GenericObjectPool pool = new GenericObjectPool();
    // setup factory and pooling DataSource
    DataSourceConnectionFactory factory = new DataSourceConnectionFactory(dataSource);
    @SuppressWarnings("unused")
    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(factory,pool,null,null,false,true);
    DataSource poolingDataSource = new PoolingDataSource(pool);


    new Resource(JPAPersistenceManager.WIDGET_DATABASE_JNDI_DATASOURCE_NAME, poolingDataSource);
  }
View Full Code Here

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

    dataSource = new PoolingDataSource(connectionPool);

    txFactory = new JdbcTransactionFactory(dataSource, this);
  }
View Full Code Here

            GenericObjectPool pool = new GenericObjectPool();
            // setup factory and pooling DataSource
            DataSourceConnectionFactory factory = new DataSourceConnectionFactory(dataSource);
            @SuppressWarnings("unused")
      PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(factory,pool,null,null,false,true);
            DataSource poolingDataSource = new PoolingDataSource(pool);
           
           
            new Resource(JPAPersistenceManager.WIDGET_DATABASE_JNDI_DATASOURCE_NAME, poolingDataSource);
        } else if (persistenceManagerType.equals(PERSISTENCE_MANAGER_TYPE_JCR)) {
            logger.info("Configuring JCR persistence manager");
View Full Code Here

           
            ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURI, user, password);
           
            dsConnectionFactory = new PoolableConnectionFactory(connectionFactory, connectionPool, null, null, false, true);
           
            dataSource = new PoolingDataSource(connectionPool);           
           
            log.info("DBCPCDatasourceComponent successfuly started!");
        }
        catch (Throwable e)
        {
View Full Code Here

        //
        // Finally, we create the PoolingDriver itself,
        // passing in the object pool we created.
        //
        PoolingDataSource dataSource = new PoolingDataSource(connectionPool);

        return dataSource;
    }
View Full Code Here

       
        // construct pooling datasource
        connectionPool = new GenericObjectPool(null, 0, GenericObjectPool.WHEN_EXHAUSTED_GROW, 0, 5);
        ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(dbUri, dbUser, dbPassword);
        new PoolableConnectionFactory(connectionFactory, connectionPool, null, null, false, true);
        DataSource dataSource = new PoolingDataSource(connectionPool);           
       
        // create JNDI context
        rootContext = new InitialContext();
        Context namingContext = lookupOrCreateNamingContext(rootContext, "java:comp");
        namingContext = lookupOrCreateNamingContext(namingContext, "env");
View Full Code Here

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

    dataSource = new PoolingDataSource(connectionPool);

    txFactory = new JdbcTransactionFactory(dataSource);
  }
View Full Code Here

            final String allowConnectionUnwrapParam;
            allowConnectionUnwrapParam = properties.getProperty(PARAM_NAME_UNWRAP_ALLOWED);
            allowConnectionUnwrap = allowConnectionUnwrapParam != null &&
                    Boolean.valueOf(allowConnectionUnwrapParam).booleanValue();
        }
        final PoolingDataSource dataSource;
        dataSource = new PoolingDataSource(connectionPool);
        dataSource.setAccessToUnderlyingConnectionAllowed(allowConnectionUnwrap);

        if(jcd != null)
        {
            final AbandonedConfig ac = jcd.getConnectionPoolDescriptor().getAbandonedConfig();
            if (ac.getRemoveAbandoned() && ac.getLogAbandoned()) {
                final LoggerWrapperPrintWriter loggerPiggyBack;
                loggerPiggyBack = new LoggerWrapperPrintWriter(log, Logger.ERROR);
                dataSource.setLogWriter(loggerPiggyBack);
            }
        }
        return dataSource;
    }
View Full Code Here

      throw new SQLException(ex.getMessage());
    }

    // create the PoolingDriver itself, passing in the
    // object pool we created.
    PoolingDataSource dataSource = new PoolingDataSource(connPool);

    return dataSource;
  }
View Full Code Here

TOP

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

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.