use of org.apache.commons.dbcp.BasicDataSource in project pinpoint by naver.
the class DataSourceConstructorInterceptor method after.
@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
if (!InterceptorUtils.isSuccess(throwable)) {
return;
}
final BasicDataSource basicDataSource = getBasicDatasource(target);
if (basicDataSource instanceof DataSourceMonitorAccessor) {
DbcpDataSourceMonitor dataSourceMonitor = new DbcpDataSourceMonitor(basicDataSource);
dataSourceMonitorRegistry.register(dataSourceMonitor);
((DataSourceMonitorAccessor) basicDataSource)._$PINPOINT$_setDataSourceMonitor(dataSourceMonitor);
}
}
use of org.apache.commons.dbcp.BasicDataSource in project jOOQ by jOOQ.
the class Example_4_1_ConnectionProvider method run.
@Test
public void run() {
Connection connection = connection();
Tools.title("Using jOOQ with a standalone connection");
System.out.println(DSL.using(connection).select().from(AUTHOR).fetch());
Tools.title("Using jOOQ with a DBCP connection pool");
BasicDataSource ds = new BasicDataSource();
ds.setDriverClassName(Tools.driver());
ds.setUrl(Tools.url());
ds.setUsername(Tools.username());
ds.setPassword(Tools.password());
System.out.println(DSL.using(ds, SQLDialect.H2).select().from(AUTHOR).fetch());
}
use of org.apache.commons.dbcp.BasicDataSource in project jackrabbit by apache.
the class ConnectionFactoryTest method testGuessValidationQuery_MYSQL.
public void testGuessValidationQuery_MYSQL() throws Exception {
DataSource ds1 = connectionFactory.getDataSource(DRIVER, MYSQL_URL, "user", "password");
assertEquals("select 1", ((BasicDataSource) ds1).getValidationQuery());
}
use of org.apache.commons.dbcp.BasicDataSource in project jackrabbit by apache.
the class ConnectionFactoryTest method testGetDataSource_defaults_Derby.
public void testGetDataSource_defaults_Derby() throws Exception {
DataSource ds1 = connectionFactory.getDataSource(DRIVER, DERBY_URL, "user", "password");
assertTrue(ds1 instanceof BasicDataSource);
BasicDataSource ds = (BasicDataSource) ds1;
assertPoolDefaults(ds, "values(1)", -1);
}
use of org.apache.commons.dbcp.BasicDataSource in project voldemort by voldemort.
the class MysqlStorageEngineTest method getDataSource.
private DataSource getDataSource() {
BasicDataSource ds = new BasicDataSource();
ds.setUrl("jdbc:mysql://localhost:3306/test");
ds.setUsername("root");
ds.setPassword("");
ds.setDriverClassName("com.mysql.jdbc.Driver");
return ds;
}
Aggregations