Examples of jdbcDataSource


Examples of org.h2.jdbcx.JdbcDataSource

public class JdbcRepositoryTestH2Config extends JdbcRepositoryTestConfig {

  @Bean
  @Override
  public DataSource dataSource() {
    JdbcDataSource ds = new JdbcDataSource();
    ds.setURL("jdbc:h2:mem:DB_CLOSE_DELAY=-1;INIT=RUNSCRIPT FROM 'classpath:schema_h2.sql'");
    return ds;
  }
View Full Code Here

Examples of org.h2.jdbcx.JdbcDataSource

        Class.forName(JDBC_DRIVER);
   
    // Or you can use a spring SingleConnectionDataSource
    // SingleConnectionDataSource realDataSource = new SingleConnectionDataSource(DriverManager.getConnection(JDBC_URL, TESTDB_USERNAME, TESTDB_PASSWORD), false);
   
    JdbcDataSource realDataSource = new JdbcDataSource();
    realDataSource.setURL(JDBC_URL);
    realDataSource.setUser(TESTDB_USERNAME);
    realDataSource.setPassword(TESTDB_PASSWORD);
   
    Log4jdbcProxyDataSource proxyDataSource = new Log4jdbcProxyDataSource(realDataSource);
   
    Connection proxyConnection = proxyDataSource.getConnection();
   
View Full Code Here

Examples of org.h2.jdbcx.JdbcDataSource

        Class.forName(JDBC_DRIVER);
       
        // Or you can use a spring SingleConnectionDataSource
        // SingleConnectionDataSource realDataSource = new SingleConnectionDataSource(DriverManager.getConnection(JDBC_URL, TESTDB_USERNAME, TESTDB_PASSWORD), false);
       
        JdbcDataSource realDataSource = new JdbcDataSource();
        realDataSource.setURL(JDBC_URL);
        realDataSource.setUser(TESTDB_USERNAME);
        realDataSource.setPassword(TESTDB_PASSWORD);
       
        Log4jdbcProxyDataSource proxyDataSource = new Log4jdbcProxyDataSource(realDataSource);
       
        Connection proxyConnection = proxyDataSource.getConnection();
        Statement st = proxyConnection.createStatement();
View Full Code Here

Examples of org.hsqldb.jdbc.JDBCDataSource

    injector.getInstance(UnitOfWork.class).end();
    injector.getInstance(EntityManagerFactory.class).close();
  }

  private static DataSource getDataSource() {
    final JDBCDataSource dataSource = new JDBCDataSource();
    dataSource.setDatabase("jdbc:hsqldb:mem:persistence");
    dataSource.setUser("sa");
    dataSource.setPassword("");
    return dataSource;
  }
View Full Code Here

Examples of org.hsqldb.jdbc.JDBCDataSource

    JdbcDataSource realDs2 = new JdbcDataSource();
    realDs2.setUser("sa");
    realDs2.setURL("jdbc:h2:mem:multids2");
    jndiResources.add(new Resource("jdbc/realDs2", realDs2));

    JDBCDataSource realDs3 = new JDBCDataSource();
    realDs3.setUser("sa");
    realDs3.setPassword("");
    realDs3.setUrl("jdbc:hsqldb:mem:multids3");
    jndiResources.add(new Resource("jdbc/realDs3", realDs3));

    // create the spy wrapper data sources and bind to jndi
    P6DataSource spyDs1 = new P6DataSource();
    spyDs1.setRealDataSource("jdbc/realDs1");
View Full Code Here

Examples of org.hsqldb.jdbc.jdbcDataSource

            // expected
         }

         prop = UnitTestDatabaseManager.getTestDbProperties();

         ds = new jdbcDataSource();
         ds.setDatabase(prop.getProperty("cache.jdbc.url"));
         ds.setUser("sa");

         context.bind(JNDI_NAME, ds);
         assertNotNull(JNDI_NAME + " bound", context.lookup(JNDI_NAME));
View Full Code Here

Examples of org.hsqldb.jdbc.jdbcDataSource

     *
     * @see junit.framework.TestCase#setUp()
     */
    @Override
    protected void setUp() throws Exception {
        ds = new jdbcDataSource();
        ds.setDatabase("jdbc:hsqldb:mem:ftpd");
        ds.setUser("sa");
        ds.setPassword("");

        createDatabase();
View Full Code Here

Examples of org.hsqldb.jdbc.jdbcDataSource

    private DataSource dataSource;
    private Connection connection;
    private StoreFactory factory;

    protected void setUp() throws Exception {
        jdbcDataSource ds = new jdbcDataSource();
        ds.setDatabase("jdbc:hsqldb:mem:aname");
        ds.setUser("sa");
        dataSource = ds;
        connection = dataSource.getConnection();
        JdbcStoreFactory f = new JdbcStoreFactory();
        f.setDataSource(dataSource);
        factory = f;
View Full Code Here

Examples of org.hsqldb.jdbc.jdbcDataSource

    }

    public void testDirectDataSource() throws Exception {
        Properties properties = new Properties();

        DataSource dataSource = new jdbcDataSource();
        properties.put("DataSource", dataSource);

        OpenEjbBrokerFactory.setThreadProperties(properties);
        BrokerService broker = null;
        try {
View Full Code Here

Examples of org.hsqldb.jdbc.jdbcDataSource

    }

    public void testLookupDataSource() throws Exception {
        Properties properties = new Properties();

        DataSource dataSource = new jdbcDataSource();
        MockInitialContextFactory.install(Collections.singletonMap("openejb/Resource/TestDs", dataSource));
        assertSame(dataSource, new InitialContext().lookup("openejb/Resource/TestDs"));

        CoreContainerSystem containerSystem = new CoreContainerSystem(new IvmJndiFactory());
        containerSystem.getJNDIContext().bind("openejb/Resource/TestDs", dataSource);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.