Package org.apache.commons.dbcp

Examples of org.apache.commons.dbcp.PoolingDriver


    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);

    //
    // Finally, we create the PoolingDriver itself...
    //
    PoolingDriver driver = new PoolingDriver();

    //
    // ...and register our pool with it.
    //
    driver.registerPool("example",connectionPool);

    //
    // Now we can just use the connect string "jdbc:apache:commons:dbcp:example"
    // to access our pool of Connections.
    //
View Full Code Here


    //
    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);
    //
    // Finally, we create the PoolingDriver itself...
    //
    PoolingDriver driver = new PoolingDriver();

    //
    // ...and register our pool with it.
    //
    driver.registerPool("example",connectionPool);

    //
    // Now we can just use the connect string "jdbc:apache:commons:dbcp:example"
    // to access our pool of Connections.
    //
View Full Code Here

    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);

    //
    // Finally, we create the PoolingDriver itself...
    //
    PoolingDriver driver = new PoolingDriver();

    //
    // ...and register our pool with it.
    //
    driver.registerPool("example",connectionPool);

    //
    // Now we can just use the connect string "jdbc:apache:commons:dbcp:example"
    // to access our pool of Connections.
    //
View Full Code Here

     * @throws Exception
     */
  public static synchronized void releaseJDBCPool(CRConfigUtil config) throws Exception {
    if (isPoolCreated(config.getName())) {
      try {
        PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");
        driver.closePool(config.getName());
        setPoolReleased(config.getName());
        log.debug("Connection pool for " + config.getName() + " has been released.");
      } catch (Exception e) {
        log.error("Could not unload JDBCPool " + config.getName(), e);
      }
View Full Code Here

    */
    //
    // Finally, we create the PoolingDriver itself...
    //
    Class.forName("org.apache.commons.dbcp.PoolingDriver");
    PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");

    //
    // ...and register our pool with it.
    //
    driver.registerPool(name, connectionPool);
    log.debug("Connection pool for " + name + " has been set up.");
    // Now we can just use the connect string "jdbc:apache:commons:dbcp:example"
    // to access our pool of Connections.
    //     
  }
View Full Code Here

                        null,
                        null,
                        false,
                        false,
                        isolationLevel);
                    PoolingDriver driver = new PoolingDriver();
                    driver.registerPool(DBCP_POOL_NAME, connectionPool);
                    // already done when loding PoolingDriver class
                    //                DriverManager.registerDriver(driver);
                } else {
                    DriverManager.registerDriver(driverInstance);
                    getLogger().log("Not using DBCP pooling", LOG_CHANNEL, Logger.WARNING);
View Full Code Here

    public int getNumIdleInPool()
    {
        int numIdle = 0;
        try
        {
            PoolingDriver driver = (PoolingDriver) DriverManager.getDriver( DRIVER_NAME );
            ObjectPool connectionPool = driver.getConnectionPool( this.getPoolName() );

            if ( log.isDebugEnabled() )
            {
                log.debug( connectionPool );
            }
View Full Code Here

    public int getNumActiveInPool()
    {
        int numActive = 0;
        try
        {
            PoolingDriver driver = (PoolingDriver) DriverManager.getDriver( DRIVER_NAME );
            ObjectPool connectionPool = driver.getConnectionPool( this.getPoolName() );

            if ( log.isDebugEnabled() )
            {
                log.debug( connectionPool );
            }
View Full Code Here

     * @throws Exception
     */
    public void shutdownDriver()
        throws Exception
    {
        PoolingDriver driver = (PoolingDriver) DriverManager.getDriver( DRIVER_NAME );
        driver.closePool( this.getPoolName() );
    }
View Full Code Here

        // PoolableConnectionFactory poolableConnectionFactory =
        new PoolableConnectionFactory( connectionFactory, connectionPool, null, null, false, true );

        // Finally, we create the PoolingDriver itself...
        Class.forName( "org.apache.commons.dbcp.PoolingDriver" );
        PoolingDriver driver = (PoolingDriver) DriverManager.getDriver( DRIVER_NAME );

        // ...and register our pool with it.
        driver.registerPool( this.getPoolName(), connectionPool );

        // Now we can just use the connect string
        // "jdbc:apache:commons:dbcp:jcs"
        // to access our pool of Connections.
    }
View Full Code Here

TOP

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

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.