use of org.h2.jdbcx.JdbcDataSource in project che by eclipse.
the class H2TestHelper method inMemoryDefault.
/**
* Creates new default datasource to in memory database
* with url {@value #DEFAULT_IN_MEMORY_DB_URL}.
* Boots database if this is invoked first time, database
* won't be shutdown until 'SHUTDOWN' query is executed
* or {@link #shutdownDefault()} is called directly.
*
* @return datasource to the in memory database
* @deprecated use {@link H2DBTestServer}.
*/
@Deprecated
public static DataSource inMemoryDefault() {
final JdbcDataSource dataSource = new JdbcDataSource();
dataSource.setUrl(DEFAULT_IN_MEMORY_DB_URL);
return dataSource;
}
use of org.h2.jdbcx.JdbcDataSource in project aries by apache.
the class TransactionLogTest method setupServerAndDataSource.
private void setupServerAndDataSource() throws SQLException {
server = Server.createTcpServer("-tcpPort", "0");
server.start();
File dbPath = new File("target/recovery-test/database");
dataSource = new JdbcDataSource();
dataSource.setUrl("jdbc:h2:tcp://127.0.0.1:" + server.getPort() + "/" + dbPath.getAbsolutePath());
}
use of org.h2.jdbcx.JdbcDataSource in project ignite by apache.
the class HibernateL2CacheTransactionalSelfTest method registryBuilder.
/**
* {@inheritDoc}
*/
@Nullable
@Override
protected StandardServiceRegistryBuilder registryBuilder() {
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
DatasourceConnectionProviderImpl connProvider = new DatasourceConnectionProviderImpl();
// JTA-aware data source.
BasicManagedDataSource dataSrc = new BasicManagedDataSource();
dataSrc.setTransactionManager(jotm.getTransactionManager());
dataSrc.setDefaultAutoCommit(false);
JdbcDataSource h2DataSrc = new JdbcDataSource();
h2DataSrc.setURL(CONNECTION_URL);
dataSrc.setXaDataSourceInstance(h2DataSrc);
connProvider.setDataSource(dataSrc);
connProvider.configure(Collections.emptyMap());
builder.addService(ConnectionProvider.class, connProvider);
builder.addService(JtaPlatform.class, new TestJtaPlatform());
builder.applySetting(Environment.TRANSACTION_COORDINATOR_STRATEGY, JtaTransactionCoordinatorBuilderImpl.class.getName());
return builder;
}
use of org.h2.jdbcx.JdbcDataSource in project che by eclipse.
the class H2DBTestServer method start.
@Override
public void start() {
final JdbcDataSource dataSource = new JdbcDataSource();
dataSource.setUrl(getUrl() + ";DB_CLOSE_DELAY=-1");
try (Connection conn = dataSource.getConnection()) {
RunScript.execute(conn, new StringReader("SELECT 1"));
} catch (SQLException x) {
throw new RuntimeException(x);
}
}
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;
}
Aggregations