use of org.apache.openejb.resource.jdbc.dbcp.BasicDataSource in project tomee by apache.
the class DefaultDataSourceCreator method pool.
@Override
public DataSource pool(final String name, final String driver, final Properties properties) {
final BasicDataSource ds = new BasicDataSource(name);
ds.setDriverClassName(driver);
build(BasicManagedDataSource.class, ds, properties);
return ds;
}
use of org.apache.openejb.resource.jdbc.dbcp.BasicDataSource in project tomee by apache.
the class JSonConfigTest method checkDsIsHere.
@Test
public void checkDsIsHere() throws NamingException {
final BasicDataSource ds = BasicDataSource.class.cast(ctx.lookup("openejb:Resource/json-datasource"));
assertNotNull(ds);
assertEquals(123, ds.getMaxTotal());
assertEquals("jdbc:hsqldb:mem:json", ds.getJdbcUrl());
}
use of org.apache.openejb.resource.jdbc.dbcp.BasicDataSource in project tomee by apache.
the class JpaTest method createNonJtaDataSource.
private DataSource createNonJtaDataSource() throws Exception {
final BasicDataSource ds = new BasicDataSource(getClass().getName() + "createNonJtaDs");
ds.setDriverClassName("org.hsqldb.jdbcDriver");
ds.setUrl("jdbc:hsqldb:mem:JpaTest");
ds.setUsername("sa");
ds.setPassword("");
ds.setMaxTotal(100);
ds.setMaxWait(10000);
ds.setTestOnBorrow(true);
return ds;
}
use of org.apache.openejb.resource.jdbc.dbcp.BasicDataSource in project tomee by apache.
the class UnenhancedTest method createNonJtaDataSource.
private DataSource createNonJtaDataSource() throws Exception {
final BasicDataSource ds = new BasicDataSource(getClass().getName() + ".createNonJtaDs");
ds.setDriverClassName("org.hsqldb.jdbcDriver");
ds.setUrl("jdbc:hsqldb:mem:JpaTest");
ds.setUsername("sa");
ds.setPassword("");
ds.setMaxTotal(100);
ds.setMaxWait(10000);
ds.setTestOnBorrow(true);
return ds;
}
Aggregations