}
}
System.setProperty("com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog");
System.setProperty("com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL", "OFF");
ComboPooledDataSource ds = new ComboPooledDataSource();
ds.setDriverClass(p.getProperty("db.driver"));
ds.setJdbcUrl(p.getProperty("db.url"));
ds.setUser(p.getProperty("db.user"));
ds.setPassword(p.getProperty("db.pass"));
ds.setAcquireRetryAttempts(10);
ds.setCheckoutTimeout(Integer.parseInt(p.getProperty("db.pool.timeout", "5000")));
ds.setBreakAfterAcquireFailure(false);
ds.setMaxPoolSize(Integer.parseInt(p.getProperty("db.pool.maxSize", "30")));
ds.setMinPoolSize(Integer.parseInt(p.getProperty("db.pool.minSize", "1")));
ds.setMaxIdleTimeExcessConnections(Integer.parseInt(p.getProperty("db.pool.maxIdleTimeExcessConnections", "0")));
ds.setIdleConnectionTestPeriod(10);
ds.setTestConnectionOnCheckin(true);
DB.datasource = ds;
url = ds.getJdbcUrl();
Connection c = null;
try {
c = ds.getConnection();
} finally {
if (c != null) {
c.close();
}
}
Logger.info("Connected to %s", ds.getJdbcUrl());
}
DB.destroyMethod = p.getProperty("db.destroyMethod", "");