use of com.jolbox.bonecp.BoneCPDataSource in project druid by alibaba.
the class Case0 method f_test_2.
public void f_test_2() throws Exception {
BoneCPDataSource dataSource = new BoneCPDataSource();
// dataSource.(10);
// dataSource.setMaxActive(50);
dataSource.setMinConnectionsPerPartition(minIdle);
dataSource.setMaxConnectionsPerPartition(maxIdle);
dataSource.setDriverClass(driverClass);
dataSource.setJdbcUrl(jdbcUrl);
// dataSource.setPoolPreparedStatements(true);
// dataSource.setMaxOpenPreparedStatements(100);
dataSource.setUsername(user);
dataSource.setPassword(password);
dataSource.setConnectionTestStatement(validationQuery);
dataSource.setPartitionCount(1);
for (int i = 0; i < LOOP_COUNT; ++i) {
p0(dataSource, "boneCP");
}
System.out.println();
}
use of com.jolbox.bonecp.BoneCPDataSource in project druid by alibaba.
the class Oracle_Case0 method test_2.
public void test_2() throws Exception {
BoneCPDataSource dataSource = new BoneCPDataSource();
// dataSource.(10);
// dataSource.setMaxActive(50);
dataSource.setMinConnectionsPerPartition(minPoolSize);
dataSource.setMaxConnectionsPerPartition(maxPoolSize);
dataSource.setDriverClass(driverClass);
dataSource.setJdbcUrl(jdbcUrl);
// dataSource.setPoolPreparedStatements(true);
// dataSource.setMaxOpenPreparedStatements(100);
dataSource.setUsername(user);
dataSource.setPassword(password);
dataSource.setConnectionTestStatement(validationQuery);
dataSource.setPartitionCount(1);
for (int i = 0; i < LOOP_COUNT; ++i) {
p0(dataSource, "boneCP");
}
System.out.println();
}
use of com.jolbox.bonecp.BoneCPDataSource in project druid by alibaba.
the class TestLRU method f_test_boneCP.
public void f_test_boneCP() throws Exception {
BoneCPDataSource ds = new BoneCPDataSource();
ds.setJdbcUrl("jdbc:mock:test");
ds.setPartitionCount(1);
ds.setMaxConnectionsPerPartition(10);
ds.setMinConnectionsPerPartition(0);
for (int i = 0; i < 10; ++i) {
f(ds, 5);
System.out.println("--------------------------------------------");
}
}
use of com.jolbox.bonecp.BoneCPDataSource in project tomee by apache.
the class BoneCPDataSourceCreator method pool.
@Override
public CommonDataSource pool(final String name, final String driver, final Properties properties) {
final BoneCPDataSource pool = createPool(properties);
if (pool.getDriverClass() == null) {
pool.setDriverClass(driver);
}
if (pool.getPoolName() == null) {
pool.setPoolName(name);
}
final String xa = String.class.cast(properties.remove("XaDataSource"));
if (xa != null) {
final XADataSource xaDs = XADataSourceResource.proxy(Thread.currentThread().getContextClassLoader(), xa);
pool.setDatasourceBean(new ManagedXADataSource(xaDs, OpenEJB.getTransactionManager(), SystemInstance.get().getComponent(TransactionSynchronizationRegistry.class)));
}
return pool;
}
use of com.jolbox.bonecp.BoneCPDataSource in project tomee by apache.
the class BoneCPDataSourceCreator method createPool.
private BoneCPDataSource createPool(final Properties properties) {
final BoneCPConfig config;
try {
config = new BoneCPConfig(prefixedProps(properties));
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
final BoneCPDataSource dataSourceProvidedPool = new BoneCPDataSource(config);
// no error
recipes.put(dataSourceProvidedPool, new ObjectRecipe(BoneCPDataSource.class.getName()));
return dataSourceProvidedPool;
}
Aggregations