public void close() throws Exception { connectionFactory.getPool().close(); }
log.info("Stopping DBCPCDatasourceComponent"); dsConnectionFactory.getPool().close();
private ObjectPool getNewConnectionPool(DataSource mySqlDataSource) { try { GenericObjectPool pool = new GenericObjectPool(null, 10); pool.setTestOnBorrow(true); ConnectionFactory factory = new DataSourceConnectionFactory(mySqlDataSource); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(factory, pool, null, "SELECT 1 FROM DUAL", false, true); Class.forName("org.apache.commons.dbcp.PoolingDriver"); PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:"); driver.registerPool("myPool", pool); return poolableConnectionFactory.getPool(); } catch (Exception e) { throw new RuntimeException("Unable to initialize connetion pooling", e); } }
pool = ((PoolableConnectionFactory)(jocl.getValue(0))).getPool(); if(null != pool) { registerPool(name,pool);
pool = ((PoolableConnectionFactory)(jocl.getValue(0))).getPool(); if(null != pool) { registerPool(name,pool);
pool = ((PoolableConnectionFactory)(jocl.getValue(0))).getPool(); if(null != pool) { registerPool(name,pool);
factory, pool, pstFactory, null, false, true); dataSource = new PoolingDataSource(poolFactory.getPool());