Search in sources :

Example 1 with JdbcDataSource

use of org.h2.jdbcx.JdbcDataSource in project che by eclipse.

the class FlywaySchemaInitializerTest method setUp.

@BeforeMethod
public void setUp() throws URISyntaxException {
    dataSource = new JdbcDataSource();
    dataSource.setUrl("jdbc:h2:mem:flyway_test;DB_CLOSE_DELAY=-1");
}
Also used : JdbcDataSource(org.h2.jdbcx.JdbcDataSource) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with JdbcDataSource

use of org.h2.jdbcx.JdbcDataSource in project java-design-patterns by iluwatar.

the class App method createDataSource.

private static DataSource createDataSource() {
    JdbcDataSource dataSource = new JdbcDataSource();
    dataSource.setURL(DB_URL);
    return dataSource;
}
Also used : JdbcDataSource(org.h2.jdbcx.JdbcDataSource)

Example 3 with JdbcDataSource

use of org.h2.jdbcx.JdbcDataSource in project che by eclipse.

the class H2DBTestServer method getDataSource.

@Override
public DataSource getDataSource() {
    final JdbcDataSource dataSource = new JdbcDataSource();
    dataSource.setUrl(getUrl());
    return dataSource;
}
Also used : JdbcDataSource(org.h2.jdbcx.JdbcDataSource)

Example 4 with JdbcDataSource

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;
}
Also used : JdbcDataSource(org.h2.jdbcx.JdbcDataSource)

Example 5 with JdbcDataSource

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());
}
Also used : JdbcDataSource(org.h2.jdbcx.JdbcDataSource) File(java.io.File)

Aggregations

JdbcDataSource (org.h2.jdbcx.JdbcDataSource)80 Connection (java.sql.Connection)24 Test (org.junit.Test)23 Before (org.junit.Before)15 XAResource (javax.transaction.xa.XAResource)13 DataSource (javax.sql.DataSource)9 Xid (javax.transaction.xa.Xid)9 SQLException (java.sql.SQLException)8 InitialContext (javax.naming.InitialContext)8 XAConnection (javax.sql.XAConnection)8 RecoveryModule (com.arjuna.ats.arjuna.recovery.RecoveryModule)7 CommitMarkableResourceRecordRecoveryModule (com.arjuna.ats.internal.jta.recovery.arjunacore.CommitMarkableResourceRecordRecoveryModule)7 XARecoveryModule (com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule)7 XAResourceRecoveryHelper (com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper)7 Statement (java.sql.Statement)7 BMScript (org.jboss.byteman.contrib.bmunit.BMScript)7 Enumeration (java.util.Enumeration)6 Properties (java.util.Properties)6 Vector (java.util.Vector)6 Uid (com.arjuna.ats.arjuna.common.Uid)4