Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.EmbeddedDataSource


   
     @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


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

   
    protected PersistenceAdapter createPersistenceAdapter(boolean delete) throws IOException {
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        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();
        broker.setUseJmx(true);
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
       
        jdbc.deleteAllMessages();
        broker.setPersistenceAdapter(jdbc);
        broker.addConnector("tcp://0.0.0.0:61616");
View Full Code Here

   
    protected BrokerService createRestartedBroker() throws Exception {
        BrokerService broker = new BrokerService();
        broker.setUseJmx(true);
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
        broker.setPersistenceAdapter(jdbc);
        broker.addConnector("tcp://0.0.0.0:61616");
        return broker;
    }
View Full Code Here

    // as long as we're in the same transaction
    private static ThreadLocal<Connection> tranConnection = new ThreadLocal();

    private static void initDataSource(String dbname, String user,
            String password) {
        ds = new EmbeddedDataSource();
        ds.setDatabaseName(dbname);
        ds.setUser(user);
        ds.setPassword(password);
        ds.setCreateDatabase("create");  
    }
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.setUseDatabaseLock(false);
View Full Code Here

    private static DataSource getCreateDataSource(File path) throws Exception {
        if (path == null) {
            throw new IllegalArgumentException("path is null");
        }
               
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName(path.getPath());
        dataSource.setCreateDatabase("create");
        return dataSource;
    }
View Full Code Here

     */
    private static DataSource getShutdownDataSource(File path) {
        if (path == null) {
            throw new IllegalArgumentException("path is null");
        }
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName(path.getPath());
        dataSource.setShutdownDatabase("shutdown");
        return dataSource;
    }
View Full Code Here

    BrokerService brokerService;
    EmbeddedDataSource dataSource;

    @Before
    public void setUpStore() throws Exception {
        dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc = new JDBCPersistenceAdapter();
        jdbc.setDataSource(dataSource);
        brokerService = new BrokerService();
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.