Package org.beangle.db.replication.wrappers

Examples of org.beangle.db.replication.wrappers.DatabaseWrapper


      if (null == is) { throw new RuntimeException("cannot find replication.properties"); }
      props.load(is);
    } catch (IOException e) {
      throw new RuntimeException("cannot find database.properties");
    }
    DatabaseWrapper source = new DatabaseWrapper(props.getProperty("source.schema"));
    source.connect(DataSourceUtil.getDataSource("source"), (Dialect) (Class.forName(props
        .getProperty("source.dialect")).newInstance()));

    DatabaseWrapper target = new DatabaseWrapper(props.getProperty("target.schema"));
    target.connect(DataSourceUtil.getDataSource("target"), (Dialect) (Class.forName(props
        .getProperty("target.dialect")).newInstance()));

    Replicator replicator = new DatabaseReplicator(source, target);

    Set<String> tables = source.getMetadata().getTables().keySet();
View Full Code Here


  DatabaseWrapper source;

  @SuppressWarnings("unused")
  @BeforeClass
  private void init() {
    source = new DatabaseWrapper("PUBLIC");
    source.connect(DataSourceUtil.getDataSource("hsqldb"), new HSQLDialect());
  }
View Full Code Here

    source.connect(DataSourceUtil.getDataSource("hsqldb"), new HSQLDialect());
  }

  @Test(dataProvider = "tables")
  public void hsqlReplication(String table) {
    DatabaseWrapper target = new DatabaseWrapper("PUBLIC");
    target.connect(DataSourceUtil.getDataSource("hsqldb_target"), new HSQLDialect());

    Replicator replicator = new DatabaseReplicator(source, target);
    replicator.addTable(table);
    replicator.start();
  }
View Full Code Here

    replicator.addTable(table);
    replicator.start();
  }

  public void testOracleReplication(String table) {
    DatabaseWrapper target = new DatabaseWrapper("test");
    target.connect(DataSourceUtil.getDataSource("oracle"), new OracleDialect());

    Replicator replicator = new DatabaseReplicator(source, target);
    replicator.addTable(table);
    replicator.start();
  }
View Full Code Here

TOP

Related Classes of org.beangle.db.replication.wrappers.DatabaseWrapper

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.