Examples of ConnectionPool


Examples of com.caucho.jca.pool.ConnectionPool

  /**
   * Clears the pool.
   */
  public void closeIdleConnections()
  {
    ConnectionPool connectionPool = _connectionPool;
   
    if (connectionPool != null)
      connectionPool.clear();
  }
View Full Code Here

Examples of com.dci.intellij.dbn.connection.ConnectionPool

                    append(false, "/", false);
                }

                append(false, getConnectionHandler().getName(), false);

                ConnectionPool connectionPool = getConnectionHandler().getConnectionPool();
                append(true, "Pool size: ", "-2", null, false);
                append(false, "" + connectionPool.getSize(), false);
                append(false, " (", false);
                append(false, "peak " + connectionPool.getPeakPoolSize(), false);
                append(false, ")", false);
            }
        }.getToolTip();
    }
View Full Code Here

Examples of com.extentech.dbutil.ConnectionPool

          String driver="org.hsqldb.jdbcDriver",
         dbURL="jdbc:hsqldb:hsql://localhost:6161",
         username="sa" ,
         password="ECOMM_SOLUTION";
        
      cp = new ConnectionPool(driver,dbURL,username,password);
      //initialContext.bind("jdbc/testDS", cp);
     }catch(Exception e){
       Logger.logErr("ERROR: Could not initialize the Connectionpool: " + e.toString());
      e.printStackTrace();
    }
View Full Code Here

Examples of com.google.code.http4j.impl.conn.ConnectionPool

  private Connection connection2;

  @BeforeClass
  public void beforeClass() {
    manager = new ConnectionPool();
    host = new BasicHost("www.google.com");
  }
View Full Code Here

Examples of com.google.code.http4j.impl.conn.ConnectionPool

  }

  @Test(expectedExceptions = TimeoutException.class)
  public void setMaxConnectionsPerHost() throws InterruptedException,
      ExecutionException, TimeoutException, IOException {
    final ConnectionManager pool = new ConnectionPool();
    pool.setMaxConnectionsPerHost(1);
    try {
      Connection connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      pool.release(connection);
      connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      ExecutorService service = Executors.newSingleThreadExecutor();
      service.invokeAny(Collections.singleton(new Callable<Connection>() {
        @Override
        public Connection call() throws Exception {
          return pool.acquire(host);
        }
      }), 2, TimeUnit.SECONDS);
    } finally {
      pool.shutdown();
    }
  }
View Full Code Here

Examples of com.google.code.http4j.impl.conn.ConnectionPool

  private Connection connection2;

  @BeforeClass
  public void beforeClass() {
    manager = new ConnectionPool();
    host = new BasicHost("www.google.com");
  }
View Full Code Here

Examples of com.google.code.http4j.impl.conn.ConnectionPool

  }

  @Test(expectedExceptions = TimeoutException.class)
  public void setMaxConnectionsPerHost() throws InterruptedException,
      ExecutionException, TimeoutException, IOException {
    final ConnectionManager pool = new ConnectionPool();
    pool.setMaxConnectionsPerHost(1);
    try {
      Connection connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      pool.release(connection);
      connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      ExecutorService service = Executors.newSingleThreadExecutor();
      service.invokeAny(Collections.singleton(new Callable<Connection>() {
        @Override
        public Connection call() throws Exception {
          return pool.acquire(host);
        }
      }), 2, TimeUnit.SECONDS);
    } finally {
      pool.shutdown();
    }
  }
View Full Code Here

Examples of com.google.code.http4j.impl.conn.ConnectionPool

 
  private ResponseParser parser;
 
  @BeforeClass
  public void beforeClass() {
    manager = new ConnectionPool();
    cookieCache = new CookieStoreAdapter();
    parser = new ResponseParser();
    executor = new BasicRequestExecutor(manager, cookieCache, parser);
  }
View Full Code Here

Examples of com.google.code.http4j.impl.conn.ConnectionPool

  @Override
  public BasicClient useConnectionPool(boolean use) {
    if (null != connectionManager) {
      connectionManager.shutdown();
    }
    connectionManager = use ? new ConnectionPool() : new SingleConnectionManager();
    return this;
  }
View Full Code Here

Examples of com.icentris.sql.ConnectionPool

        throw new IllegalStateException("cannot find WEB-INF/classes/db.properties!");
      }
      stream = propsURL.openStream();
      dbProps.load(stream);
      PropertiesUtil.interpolateProperties(dbProps);
      ConnectionPool pool = new ConnectionPool( dbProps.getProperty("dbDriver"), dbProps.getProperty("dbUrl"),
                                                dbProps.getProperty("dbUser"),   dbProps.getProperty("dbPass") );
      pool.setMaxConnections  ( Integer.parseInt(dbProps.getProperty("maxConnections"))   );
      pool.setMinConnections  ( Integer.parseInt(dbProps.getProperty("minConnections"))   );
      pool.setTimeoutInMinutes( Integer.parseInt(dbProps.getProperty("timeoutInMinutes")) );
      pool.setStrictTimeout   ( "true".equals(dbProps.getProperty("strictTimeout"))       );
      pool.setCloseOnError    ( "true".equals(dbProps.getProperty("closeOnError"))        );
      pool.setShowDebugging   ( "true".equals(dbProps.getProperty("showDebugging"))       );
      pool.setCallersToIgnore ( PropertiesUtil.getArray("callersToIgnore", ',', dbProps)  );
      double pruneRunInMins = Double.parseDouble( dbProps.getProperty("pruneRunInMinutes") );
      if ( pruneRunInMins > -1 ) {
        pool.startPruner( pruneRunInMins );
      }
      ConnectionPool.initializePool("default", pool);
     
    } catch ( Exception e ) {
         logger.error("init(ServletConfig)", e); //$NON-NLS-1$
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.