Package org.apache.commons.dbcp

Examples of org.apache.commons.dbcp.PoolingDriver


        System.out.println("NumActive: " + connectionPool.getNumActive());
        System.out.println("NumIdle: " + connectionPool.getNumIdle());
    }

    public static void shutdownDriver() throws Exception {
        PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");
        driver.closePool("example");
    }
View Full Code Here


    {
        if (initialized)
        {
            initialized = false;
            // Get the registered DBCP pooling driver
            PoolingDriver driver = (PoolingDriver)DriverManager.getDriver("jdbc:apache:commons:dbcp:");

            // Close the named pool
            if (driver != null)
                driver.closePool(poolName);
        }
    }
View Full Code Here

            }

            //
            // Finally, we get the PoolingDriver itself...
            //
            PoolingDriver driver = (PoolingDriver)DriverManager.getDriver("jdbc:apache:commons:dbcp:");

            //
            // ...and register our pool with it.
            //
            if (driver != null)
                driver.registerPool(poolName, connectionPool);

            // Old SimplePool init
            //DriverManager.registerDriver(new SimplePool());
            initialized = true;
        }
View Full Code Here

      throw new PoolNotFoundException("Failed when creating database connections pool", e);
    }
  }

  public void destroy(String name) throws Exception {
    PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");
    driver.closePool(name);
  }
View Full Code Here

    // required by dbcp
    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(
        connectionFactory, connectionPool, keyedObject, null, false, true);

    Class.forName("org.apache.commons.dbcp.PoolingDriver");
    PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");
    driver.registerPool(contextName + "_" + name, connectionPool);

    if (this.defaultPoolName == null || this.defaultPoolName.equals("")) {
      this.defaultPoolName = name;
      this.bbdd = dbServer;
      this.rdbms = rdbms;
View Full Code Here

  public ObjectPool getPool(String poolName) throws PoolNotFoundException {
    if (poolName == null || poolName.equals(""))
      throw new PoolNotFoundException("CouldnĀ“t get an unnamed pool");
    ObjectPool connectionPool = null;
    try {
      PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");
      connectionPool = driver.getConnectionPool(contextName + "_" + poolName);
    } catch (SQLException ex) {
      log4j.error(ex);
    }
    if (connectionPool == null)
      throw new PoolNotFoundException(poolName + " not found");
View Full Code Here

        driver.registerPool("infoGlueJDBCPropertySet",connectionPool);
    }

    public void printDriverStats() throws Exception
    {
        PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");
        ObjectPool connectionPool = driver.getConnectionPool("infoGlueJDBCPropertySet");
       
        //System.out.println("NumActive: " + connectionPool.getNumActive());
        //System.out.println("NumIdle: " + connectionPool.getNumIdle());

        if(logger.isInfoEnabled())
View Full Code Here

        }
    }

    public void shutdownDriver() throws Exception
    {
        PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");
        driver.closePool("infoGlueJDBCPropertySet");
    }
View Full Code Here

    ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(getJdbcURL(), getUserId(), getUserPwd());
    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, connectPool, null, null, true, true);
    poolableConnectionFactory.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);

    PoolingDriver driver = new PoolingDriver();
    driver.registerPool(DriverName, connectPool);
  }
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.