use of com.mchange.v2.c3p0.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.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.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.ComboPooledDataSource in project jforum2 by rafaelsteil.
the class C3P0PooledConnection method init.
/**
*
* @see net.jforum.DBConnection#init()
*/
public void init() throws Exception {
this.ds = new ComboPooledDataSource();
this.ds.setDriverClass(SystemGlobals.getValue(ConfigKeys.DATABASE_CONNECTION_DRIVER));
this.ds.setJdbcUrl(SystemGlobals.getValue(ConfigKeys.DATABASE_CONNECTION_STRING));
this.ds.setMinPoolSize(SystemGlobals.getIntValue(ConfigKeys.DATABASE_POOL_MIN));
this.ds.setMaxPoolSize(SystemGlobals.getIntValue(ConfigKeys.DATABASE_POOL_MAX));
this.ds.setIdleConnectionTestPeriod(SystemGlobals.getIntValue(ConfigKeys.DATABASE_PING_DELAY));
this.extraParams();
}
use of com.mchange.v2.c3p0.ComboPooledDataSource in project databus by linkedin.
the class MysqlMaxSCNHandler method create.
public static MysqlMaxSCNHandler create(StaticConfig config) throws DatabusException {
ComboPooledDataSource cpds = createConnectionPool(config);
MysqlMaxSCNHandler handler = new MysqlMaxSCNHandler(config, cpds);
handler.loadInitialValue(cpds);
return handler;
}
Aggregations