use of org.h2.jdbcx.JdbcDataSource in project jdbi by jdbi.
the class TestOnDemandSqlObject method setUp.
@Before
public void setUp() throws Exception {
ds = new JdbcDataSource();
// in MVCC mode h2 doesn't shut down immediately on all connections closed, so need random db name
ds.setURL(String.format("jdbc:h2:mem:%s;MVCC=TRUE", UUID.randomUUID()));
db = Jdbi.create(ds);
db.installPlugin(new SqlObjectPlugin());
handle = db.open();
handle.execute("create table something (id int primary key, name varchar(100))");
db.installPlugin(tracker);
}
use of org.h2.jdbcx.JdbcDataSource in project jdbi by jdbi.
the class TestReentrancy method setUp.
@Before
public void setUp() throws Exception {
JdbcDataSource ds = new JdbcDataSource();
// in MVCC mode h2 doesn't shut down immediately on all connections closed, so need random db name
ds.setURL(String.format("jdbc:h2:mem:%s;MVCC=TRUE", UUID.randomUUID()));
db = Jdbi.create(ds);
db.installPlugin(new SqlObjectPlugin());
db.registerRowMapper(new SomethingMapper());
handle = db.open();
handle.execute("create table something (id int primary key, name varchar(100))");
}
use of org.h2.jdbcx.JdbcDataSource in project spring-boot by spring-projects.
the class DataSourceBuilderTests method buildWhenH2TypeSpecifiedWithDriverClassReturnsExpectedDataSource.
// gh-26631
@Test
void buildWhenH2TypeSpecifiedWithDriverClassReturnsExpectedDataSource() {
this.dataSource = DataSourceBuilder.create().url("jdbc:h2:test").type(JdbcDataSource.class).driverClassName("org.h2.jdbcx.JdbcDataSource").username("test").password("secret").build();
assertThat(this.dataSource).isInstanceOf(JdbcDataSource.class);
JdbcDataSource h2DataSource = (JdbcDataSource) this.dataSource;
assertThat(h2DataSource.getUser()).isEqualTo("test");
assertThat(h2DataSource.getPassword()).isEqualTo("secret");
}
use of org.h2.jdbcx.JdbcDataSource in project Activiti by Activiti.
the class MultiTenantProcessEngineTest method createDataSource.
// Helper //////////////////////////////////////////
private DataSource createDataSource(String jdbcUrl, String jdbcUsername, String jdbcPassword) {
JdbcDataSource ds = new JdbcDataSource();
ds.setURL(jdbcUrl);
ds.setUser(jdbcUsername);
ds.setPassword(jdbcPassword);
return ds;
}
use of org.h2.jdbcx.JdbcDataSource in project syndesis by syndesisio.
the class ActivityTrackingControllerTest method before.
@Before
public void before() {
JdbcDataSource ds = new JdbcDataSource();
ds.setURL("jdbc:h2:mem:t;DB_CLOSE_DELAY=-1;MODE=PostgreSQL");
this.dbi = new DBI(ds);
this.jsondb = new SqlJsonDB(dbi, null);
this.jsondb.createTables();
}
Aggregations