use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class Case1 method test_druid.
public void test_druid() throws Exception {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setInitialSize(initialSize);
dataSource.setMaxActive(maxActive);
dataSource.setMinIdle(minPoolSize);
dataSource.setMaxIdle(maxPoolSize);
dataSource.setPoolPreparedStatements(true);
dataSource.setDriverClassName(driverClass);
dataSource.setUrl(jdbcUrl);
dataSource.setPoolPreparedStatements(true);
dataSource.setUsername(user);
dataSource.setPassword(password);
dataSource.setValidationQuery(validationQuery);
dataSource.setTestOnBorrow(false);
for (int i = 0; i < loopCount; ++i) {
p0(dataSource, "druid", threadCount);
}
System.out.println();
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class Case2 method test_0.
public void test_0() throws Exception {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setInitialSize(initialSize);
dataSource.setMaxActive(maxActive);
dataSource.setMinIdle(minPoolSize);
dataSource.setMaxIdle(maxPoolSize);
dataSource.setPoolPreparedStatements(true);
dataSource.setDriverClassName(driverClass);
dataSource.setUrl(jdbcUrl);
dataSource.setPoolPreparedStatements(true);
dataSource.setUsername(user);
dataSource.setPassword(password);
dataSource.setValidationQuery(validationQuery);
dataSource.setTestOnBorrow(testOnBorrow);
for (int i = 0; i < executeCount; ++i) {
p0(dataSource, "druid", threadCount);
}
System.out.println();
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class ReuseStatFilterTest method setUp.
protected void setUp() throws Exception {
dataSourceA = new DruidDataSource();
dataSourceB = new DruidDataSource();
dataSourceA.setUrl("jdbc:mock:xxx_A");
dataSourceB.setUrl("jdbc:mock:xxx_B");
StatFilter filter = new StatFilter();
dataSourceA.getProxyFilters().add(filter);
dataSourceB.getProxyFilters().add(filter);
dataSourceA.init();
dataSourceB.init();
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class Slf4jFilterTest method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setFilters("slf4j");
dataSource.setDbType("mysql");
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class StatFilterAfterResetTest method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setFilters("stat");
dataSource.init();
}
Aggregations