Examples of EmbeddedDataSource


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

Examples of org.apache.derby.jdbc.EmbeddedDataSource

        System.setProperty("derby.storage.fileSyncTransactionLog", "true");

        // load the Embedded driver to initialize the home
        new org.apache.derby.jdbc.EmbeddedDriver();

        EmbeddedDataSource datasource = new EmbeddedDataSource();
        datasource.setDatabaseName("SystemDatabase");
        datasource.setCreateDatabase("create");
        try {
            Connection c = datasource.getConnection();
            c.close();
        } catch (SQLException e) {
            while (e.getNextException() != null) {
                e.printStackTrace();
                e = e.getNextException();
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

  public void start() {
    System.out.println("Starting server");
    try {

      Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
      EmbeddedDataSource ds = new EmbeddedDataSource();
      ds.setConnectionAttributes("create=true");
      ds.setDatabaseName("classes");

      logger.info("Initializing jobProgressStates monitor");
      ProgressStateFactory factory = new ProgressStateFactory();
      jobProgressStates = factory.getProgressStates();
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

  public void start() {
    System.out.println("Starting hub");
    try {

      Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
      EmbeddedDataSource ds = new EmbeddedDataSource();
      ds.setConnectionAttributes("create=true");
      ds.setDatabaseName("classes");

      JobHub.prepareDataSource(ds);

      logger.info("Initializing service");
      jobHub = new JobHub(ds);
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

    taskProgressStates = monitorFactory.getProgressStates();

    if (!internal) {
      logger.info("Preparing data source");
      EmbeddedDataSource ds = null;
      try {
        Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
        ds = new EmbeddedDataSource();
        ds.setConnectionAttributes("create=true");
        ds.setDatabaseName("classes");
        worker.setDataSource(ds);
      } catch (ClassNotFoundException e) {
        logger.error("Could not locate database driver.", e);
      } catch (SQLException e) {
        logger.error("Error occurred while initializing data source.", e);
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

    protected BrokerService createBroker(boolean withJMX) throws Exception {
        BrokerService broker = new BrokerService();

        broker.setUseJmx(withJMX);

        EmbeddedDataSource embeddedDataSource = (EmbeddedDataSource) DataSourceServiceSupport.createDataSource(IOHelper.getDefaultDataDirectory());
        embeddedDataSource.setCreateDatabase("create");

        //wire in a TestTransactionContext (wrapper to TransactionContext) that has an executeBatch()
        // method that can be configured to throw a SQL exception on demand
        JDBCPersistenceAdapter jdbc = new TestJDBCPersistenceAdapter();
        jdbc.setDataSource(embeddedDataSource);
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

    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

Examples of org.apache.derby.jdbc.EmbeddedDataSource

   
    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

Examples of org.apache.derby.jdbc.EmbeddedDataSource

    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

Examples of org.apache.derby.jdbc.EmbeddedDataSource

    }

    protected BrokerService createBroker() throws Exception {
        BrokerService broker = new BrokerService();
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");

        DefaultJDBCAdapter adapter = new DefaultJDBCAdapter();
        jdbc.setAdapter(adapter);

        Statements statements = new Statements();
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.