Package com.jolbox.bonecp

Examples of com.jolbox.bonecp.BoneCP


      boneConf.setPartitionCount(3);
      // 设置连接空闲时间(分钟)
      boneConf.setIdleMaxAge(40);
      // 每60秒检查所有连接池中的空闲连接
      boneConf.setIdleConnectionTestPeriod(60);
      boneCp = new BoneCP(boneConf);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here


      boneConf.setPartitionCount(3);
      // 设置连接空闲时间(分钟)
      boneConf.setIdleMaxAge(40);
      // 每60秒检查所有连接池中的空闲连接
      boneConf.setIdleConnectionTestPeriod(60);
      boneCp = new BoneCP(boneConf);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    }

    @Override
    public DataSource pool(final String name, final DataSource ds, final Properties properties) {
        final BoneCPConfig config;
        final BoneCP pool;
        try {
            config = new BoneCPConfig(prefixedProps(properties));
            pool = new BoneCP(config);
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }
        return build(BoneCPDataSourceProvidedPool.class, new BoneCPDataSourceProvidedPool(pool), new Properties());
    }
View Full Code Here

  }

  @Override
  public synchronized void start() {
    try {
      pool = new BoneCP(config);
    } catch (SQLException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    }

    @Override
    public DataSource pool(final String name, final DataSource ds, final Properties properties) {
        final BoneCPConfig config;
        final BoneCP pool;
        try {
            config = new BoneCPConfig(prefixedProps(properties));
            pool = new BoneCP(config);
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }
        return build(BoneCPDataSourceProvidedPool.class, new BoneCPDataSourceProvidedPool(pool), new Properties());
    }
View Full Code Here

    config.setJdbcUrl(driverUrl);
    config.setMaxConnectionsPerPartition(10);
    config.setPartitionCount(1);
    config.setUser(user);
    config.setPassword(passwd);
    connPool = new BoneCP(config);
  }
View Full Code Here

    config.setUsername(userName);
    config.setPassword(password);
    config.setPartitionCount(1);
    config.setDefaultAutoCommit(false);

    connectionPool = new BoneCP(config); // setup the connection pool
  }
View Full Code Here

    }

    @Override
    public DataSource pool(final String name, final DataSource ds, final Properties properties) {
        final BoneCPConfig config;
        final BoneCP pool;
        try {
            config = new BoneCPConfig(prefixedProps(properties));
            pool = new BoneCP(config);
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }
        return build(BoneCPDataSourceProvidedPool.class, new BoneCPDataSourceProvidedPool(pool), new Properties());
    }
View Full Code Here

    config.setJdbcUrl(driverUrl);
    config.setMaxConnectionsPerPartition(10);
    config.setPartitionCount(1);
    config.setUser(user);
    config.setPassword(passwd);
    connPool = new BoneCP(config);
  }
View Full Code Here

    config.setConnectionHook(new BoneCPHack(config.getConnectionHook()));
    return config;
  }

  public void testNonBlocking() throws SQLException {
    final BoneCP bcp = new BoneCP(createConfig());
    BlockingOperation.off();
    try {
      final Connection h1 = bcp.getConnection();
      assertNotNull(h1);
      final Connection h2 = bcp.getConnection();
      assertNotNull(h2);
      final Connection h3 = bcp.getConnection();
      assertNotNull(h3);
      h1.close();
      h2.close();
      h3.close();
    } finally {
View Full Code Here

TOP

Related Classes of com.jolbox.bonecp.BoneCP

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.