use of com.mchange.v2.c3p0.jacksonTest.ComboPooledDataSource in project druid by alibaba.
the class Case0 method f_test_c3p0.
public void f_test_c3p0() throws Exception {
ComboPooledDataSource dataSource = new ComboPooledDataSource();
// dataSource.(10);
// dataSource.setMaxActive(50);
dataSource.setMinPoolSize(minIdle);
dataSource.setMaxPoolSize(maxIdle);
dataSource.setDriverClass(driverClass);
dataSource.setJdbcUrl(jdbcUrl);
// dataSource.setPoolPreparedStatements(true);
// dataSource.setMaxOpenPreparedStatements(100);
dataSource.setUser(user);
dataSource.setPassword(password);
for (int i = 0; i < LOOP_COUNT; ++i) {
p0(dataSource, "c3p0");
}
System.out.println();
}
use of com.mchange.v2.c3p0.jacksonTest.ComboPooledDataSource in project druid by alibaba.
the class TestRollBack method init.
// jdbcUrl = "jdbc:oracle:thin:@a.b.c.d:1521:ocnauto";
// user = "alibaba";
// password = "ccbuauto";
@BeforeClass
public static void init() throws PropertyVetoException, SQLException {
c3p0 = new ComboPooledDataSource();
// c3p0.setDriverClass("oracle.jdbc.driver.OracleDriver");
c3p0.setDriverClass(driver);
c3p0.setJdbcUrl(url);
c3p0.setUser(user);
c3p0.setPassword(password);
druid = new DruidDataSource();
druid.setUrl(url);
druid.setUsername(user);
druid.setPassword(password);
druid.setFilters("stat,trace,encoding");
druid.setDefaultAutoCommit(false);
dao_c3p0 = new NutDao(c3p0);
dao_druid = new NutDao(druid);
if (!dao_c3p0.exists("msg")) {
// 字段长度5
dao_c3p0.execute(Sqls.create("create table msg(message varchar(5))"));
}
}
use of com.mchange.v2.c3p0.jacksonTest.ComboPooledDataSource in project druid by alibaba.
the class TestLRU method f_test_c3p0.
public void f_test_c3p0() throws Exception {
ComboPooledDataSource ds = new ComboPooledDataSource();
ds.setJdbcUrl("jdbc:mock:test");
ds.setMaxPoolSize(10);
ds.setMinPoolSize(0);
for (int i = 0; i < 10; ++i) {
f(ds, 5);
System.out.println("--------------------------------------------");
}
}
use of com.mchange.v2.c3p0.jacksonTest.ComboPooledDataSource in project druid by alibaba.
the class Case4 method test_c3p0.
public void test_c3p0() throws Exception {
ComboPooledDataSource dataSource = new ComboPooledDataSource();
// dataSource.(10);
// dataSource.setMaxActive(50);
dataSource.setMinPoolSize(minPoolSize);
dataSource.setMaxPoolSize(maxPoolSize);
dataSource.setDriverClass(driverClass);
dataSource.setJdbcUrl(jdbcUrl);
dataSource.setMaxStatements(maxOpenPreparedStatements);
dataSource.setUser(user);
dataSource.setPassword(password);
for (int i = 0; i < loopCount; ++i) {
p0(dataSource, "c3p0", threadCount);
}
System.out.println();
}
use of com.mchange.v2.c3p0.jacksonTest.ComboPooledDataSource in project midpoint by Evolveum.
the class DataSourceFactory method destroy.
public void destroy() {
if (dataSource instanceof ComboPooledDataSource) {
ComboPooledDataSource ds = (ComboPooledDataSource) dataSource;
ds.close();
}
}
Aggregations