Examples of DBPoolDataSource


Examples of snaq.db.DBPoolDataSource

   
  }

  private DataSource multiThreadedDBPool(boolean doPreparedStatement) throws PropertyVetoException, InterruptedException, SQLException {

    DBPoolDataSource ds = new DBPoolDataSource();
    ds.setName("db-pool-ds");
    ds.setDriverClassName("com.jolbox.bonecp.MockJDBCDriver");
    ds.setUrl(url);
    ds.setUser(username);
    ds.setPassword(password);
    ds.setMinPool(pool_size);
    ds.setMaxPool(pool_size);
    ds.setMaxSize(pool_size);
 
          if (doPreparedStatement){
            // not yet implemented in this version
          }
View Full Code Here

Examples of snaq.db.DBPoolDataSource

   *
   * @return time taken
   * @throws SQLException
   */
  private long singleDBPool() throws SQLException{
    DBPoolDataSource ds = new DBPoolDataSource();
    ds.setName("db-pool-ds");
    ds.setDriverClassName("com.jolbox.bonecp.MockJDBCDriver");
    ds.setUrl(url);
    ds.setUser(username);
    ds.setPassword(password);
    ds.setMinPool(pool_size);
    ds.setMaxPool(pool_size);
    ds.setMaxSize(pool_size);
 
    long start = System.currentTimeMillis();
    for (int i=0; i < MAX_CONNECTIONS; i++){
      Connection conn = ds.getConnection();
      conn.close();
    }
    long end = (System.currentTimeMillis() - start);


    ds.release();
    return end;

  }
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.