Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.EmbeddedDataSource


     * It attempts to recreate the tables everytime the test is executed.
     *
     * @return PersistenceAdapter - persistence adapter.
     */
    protected PersistenceAdapter createPersistenceAdapter() {
        EmbeddedDataSource ds = new EmbeddedDataSource();
        ds.setDatabaseName("testdb");
        if (!init) {
            ds.setCreateDatabase("create");
        }

        JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter(ds, new DefaultWireFormat());

        if (!init) {
View Full Code Here


        broker.start();
    }

    private void stopDerby() {
        LOG.info("STOPPING DB!@!!!!");
        final EmbeddedDataSource ds = dataSource;
        try {
            ds.setShutdownDatabase("shutdown");
            ds.getConnection();
        } catch (Exception ignored) {
        }

    }
View Full Code Here

*/
public class JDBCDurableSubscriptionTest extends DurableSubscriptionTestSupport {

    protected PersistenceAdapter createPersistenceAdapter() throws IOException {
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
        jdbc.setCleanupPeriod(1000); // set up small cleanup period
        return jdbc;
    }
View Full Code Here

    JDBCPersistenceAdapter jdbc;

    @Override
    protected PersistenceAdapter createPersistenceAdapter(boolean delete) throws Exception {
        jdbc = new JDBCPersistenceAdapter();
        dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        dataSource.setShutdownDatabase(null);
        jdbc.setDataSource(dataSource);
        jdbc.deleteAllMessages();
View Full Code Here

public class JDBCStoreBrokerTest extends BrokerTest {

    protected BrokerService createBroker() throws Exception {
        BrokerService broker = new BrokerService();
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
       
        jdbc.deleteAllMessages();
        broker.setPersistenceAdapter(jdbc);
        return broker;
View Full Code Here

    }
   
    protected BrokerService createRestartedBroker() throws Exception {
        BrokerService broker = new BrokerService();
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
        broker.setPersistenceAdapter(jdbc);
        return broker;
    }
View Full Code Here

        jdbc.setEnableAudit(true);
       
        brokerService.setSchedulerSupport(false);
        brokerService.setPersistenceAdapter(jdbc);
        jdbc.setBrokerService(brokerService);
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
        if( delete ) {
            jdbc.deleteAllMessages();
        }
        return jdbc;
View Full Code Here

    protected BrokerService createBroker() throws Exception {

        BrokerService broker = new BrokerService();
        jdbc = new BrokenPersistenceAdapter();

        dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("target/derbyDb");
        dataSource.setCreateDatabase("create");

        jdbc.setDataSource(dataSource);
        jdbc.setUseLock(false);
View Full Code Here

   
     @Override
     protected void setPersistentAdapter(BrokerService brokerService)
             throws Exception {
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
        brokerService.setPersistenceAdapter(jdbc);
    }
View Full Code Here

public class JDBCNetworkBrokerDetachTest extends NetworkBrokerDetachTest {

    protected void configureBroker(BrokerService broker) throws Exception {
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName(broker.getBrokerName());
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
        jdbc.deleteAllMessages();
        broker.setPersistenceAdapter(jdbc);
        broker.setUseVirtualTopics(false);
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.jdbc.EmbeddedDataSource

Copyright © 2018 www.massapicom. 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.