Package org.xmlBlaster.contrib.replication

Examples of org.xmlBlaster.contrib.replication.TableToWatchInfo


         boolean doWarn = false;
         boolean force = true;
         dbSpecific.bootstrap(conn, doWarn, force);
         String destination = null;
         boolean forceSend = false;
         TableToWatchInfo tableToWatch = new TableToWatchInfo(" ", specificHelper.getOwnSchema(dbPool), this.tableName);
         tableToWatch.setActions("");
         tableToWatch.setTrigger("DUMMY");
         dbSpecific.addTableToWatch(tableToWatch, false, new String[] { destination }, forceSend);
      }
      catch (Exception ex) {
         if (conn != null)
            dbPool.release(conn);
View Full Code Here


            log.fine("parsed message: " + msg1);
            int numOfCols = dbUpdateInfo.getDescription().getColumns().length;
            assertTrue("Number of columns must be at least one (to detect that metadata is retrieved)", numOfCols > 0);
            assertXMLEqual("Parsing of message is working correctly: output xml is not the same as input xml", msg, msg1);

            TableToWatchInfo tableToWatch = new TableToWatchInfo();
            tableToWatch.setActions("IDU");
            String functionAndTrigger = dbSpecific.createTableTrigger(dbUpdateInfo.getDescription(), tableToWatch);
           
            log.fine("-- ---------------------------------------------------------------------------");
            log.fine(functionAndTrigger);
            log.fine("-- ---------------------------------------------------------------------------");
View Full Code Here

         boolean doWarn = false;
         boolean force = true;
         this.dbSpecific.bootstrap(conn, doWarn, force);
         String destination = null;
         boolean forceSend = false;
         TableToWatchInfo tableToWatch = new TableToWatchInfo(null, this.specificHelper.getOwnSchema(this.pool), this.dbHelper.getIdentifier(this.tableName));
         tableToWatch.setActions("IDU");
         this.dbSpecific.addTableToWatch(tableToWatch, false, new String[] { destination }, forceSend);
      }
      catch (Exception ex) {
         log.warning(ex.getMessage());
         if (conn != null)
View Full Code Here

         {
            sql = "{? = call " + this.replPrefix + "add_table(?,?,?,?)}"; // name text, content text)
            try {
               boolean force = false;
               boolean forceSend = false;
               TableToWatchInfo tableToWatch = new TableToWatchInfo(null, this.specificHelper.getOwnSchema(this.pool), "TEST_REPLICATION");
               tableToWatch.setActions("");
               tableToWatch.setTrigger(null);
               this.dbSpecific.addTableToWatch(tableToWatch, force, null, forceSend);
               CallableStatement st = conn.prepareCall(sql);
               st.setString(2, null);
               st.setString(3, this.specificHelper.getOwnSchema(this.pool));
               st.setString(4, "TEST_REPLICATION");
View Full Code Here

      if (doReplicate)
         flags = "IDU";
      boolean force = false;
      String destination = null;
      boolean forceSend = false;
      TableToWatchInfo tableToWatch = new TableToWatchInfo(catalog, schema, tableName);
      tableToWatch.setActions(flags);
      tableToWatch.setTrigger(null);
      this.dbSpecific.addTableToWatch(tableToWatch, force, new String[] { destination }, forceSend);
      Statement st = conn.createStatement();
      ResultSet rs = st.executeQuery("SELECT * from " + this.replPrefix + "tables WHERE tablename='" + this.dbHelper.getIdentifier(tableName) + "'");
      assertTrue("testing '" + tableName + "' went wrong since no entries found", rs.next());
      String name = rs.getString(3);
View Full Code Here

         // add the tables to be detected to the repl_tables table
         boolean force = false;
         String destination = null;
         boolean forceSend = false;

         TableToWatchInfo tableToWatch = new TableToWatchInfo(null, this.specificHelper.getOwnSchema(pool), tableName);
         tableToWatch.setActions("IDU");
         tableToWatch.setTrigger(null);
         this.dbSpecific.addTableToWatch(tableToWatch, force, new String[] { destination }, forceSend);
        
         // force a call to the function which detects CREATE / DROP / ALTER operations: writes on repl_items
         this.dbSpecific.forceTableChangeCheck();
View Full Code Here

         // add the tables to be detected to the repl_tables table
         boolean force = false;
         String destination = null;
         boolean forceSend = false;
         TableToWatchInfo tableToWatch = new TableToWatchInfo(null, this.specificHelper.getOwnSchema(pool), tableName);
         tableToWatch.setActions("IDU");
         tableToWatch.setTrigger(null);
         this.dbSpecific.addTableToWatch(tableToWatch, force, new String[] { destination }, forceSend);

         // check that nothing has been written in repl_items
         Statement st = conn.createStatement();
         ResultSet rs = st.executeQuery("SELECT * from " + this.replPrefix + "items");
View Full Code Here

         String sql = null;
         try {
            boolean force = false;
            String destination = null;
            boolean forceSend = false;
            TableToWatchInfo tableToWatch = new TableToWatchInfo(null, this.specificHelper.getOwnSchema(pool), tableName);
            tableToWatch.setActions("IDU");
            getDbSpecific().addTableToWatch(tableToWatch, force, new String[] { destination }, forceSend);
         }
         catch (Exception ex) {
            ex.printStackTrace();
            assertTrue("Testing if addition of table '" + tableName + "' to tables to replicate (" + this.replPrefix + "tables) succeeded: An exception should not occur here", false);
View Full Code Here

         String sql = null;
         try {
            boolean force = false;
            String destination = null;
            boolean forceSend = false;
            TableToWatchInfo tableToWatch = new TableToWatchInfo(null, this.specificHelper.getOwnSchema(pool), tableName);
            tableToWatch.setActions("IDU");
            getDbSpecific().addTableToWatch(tableToWatch, force, new String[] { destination }, forceSend);
         }
         catch (Exception ex) {
            ex.printStackTrace();
            assertTrue("Testing if addition of table '" + tableName + "' to tables to replicate (" + this.replPrefix + "tables) succeeded: An exception should not occur here", false);
View Full Code Here

  
   /**
    * @see org.xmlBlaster.contrib.replication.I_DbSpecific#addTrigger(java.sql.Connection, java.lang.String, java.lang.String, java.lang.String, org.xmlBlaster.contrib.dbwriter.info.SqlInfo)
    */
   public void addTrigger(Connection conn, String catalog, String schema, String tableName) throws Exception {
      TableToWatchInfo tableToWatch = getTableToWatch(conn, catalog, schema, tableName);
      SqlInfo sqlInfo = new SqlInfo(this.info);
      if (sqlInfo.fillMetadata(conn, catalog, schema, tableName, null, null)) {
         final boolean force = true;
         addTrigger(conn, tableToWatch, sqlInfo, force);
      }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.replication.TableToWatchInfo

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.