Package org.xmlBlaster.contrib.dbwriter.info

Examples of org.xmlBlaster.contrib.dbwriter.info.SqlRow.toXml()


            conn.setAutoCommit(false);
            try {
               for (int i=0; i < rows.size(); i++) {
                  SqlRow row = (SqlRow)rows.get(i);
                  ClientProperty oldRowProp = new ClientProperty(ReplicationConstants.OLD_CONTENT_ATTR, null, null, row.toXml("", false));
                  row.setAttribute(oldRowProp);
                  try {
                     I_Parser parser = new SqlInfoParser();
                     parser.init(this.info);
                     int ret = desc.update(conn, row, parser);
View Full Code Here


                     int ret = desc.update(conn, row, parser);
                     if (ret != 1)
                        throw new Exception("the number of updated entries is wrong '" + ret + "' but should be 1");
                  }
                  catch(Exception ex) {
                     log.info("exception when updating '" + row.toXml("") + " where description is '" + desc.toXml("") + "'");
                     throw ex;
                  }
                  try {
                     int ret = desc.delete(conn, row);
                     if (ret != 1)
View Full Code Here

                     int ret = desc.delete(conn, row);
                     if (ret != 1)
                        throw new Exception("the number of deleted entries is wrong '" + ret + "' but should be 1");
                  }
                  catch(Exception ex) {
                     log.info("exception when deleting '" + row.toXml("") + " where description is '" + desc.toXml("") + "'");
                     throw ex;
                  }
                  try {
                     int ret = desc.insert(conn, row);
                     if (ret != 1)
View Full Code Here

                     int ret = desc.insert(conn, row);
                     if (ret != 1)
                        throw new Exception("the number of inserted entries is wrong '" + ret + "' but should be 1");
                  }
                  catch(Exception ex) {
                     log.info("exception when inserting '" + row.toXml("") + " where description is '" + desc.toXml("") + "'");
                     throw ex;
                  }
               }
               Thread.sleep(this.sleepDelay);
               conn.commit();
View Full Code Here

         ResultSet rs = st.executeQuery(sql);
         if (rs.next()) {
            obj.fillOneRowWithObjects(rs, transformer);
            SqlRow row = (SqlRow)obj.getRows().get(0);
            rs.close();
            return row.toXml("", false);
         }
         else {
            log.severe("The entry guid='" + guid + "' for table '" + completeTable + "' was not found (anymore)");
            return "";
         }
View Full Code Here

                     catalog = this.mapper.getMappedCatalog(originalCatalog, originalSchema, originalTable, null, originalCatalog);
                     schema = this.mapper.getMappedSchema(originalCatalog, originalSchema, originalTable, null, originalSchema);
                     table = this.mapper.getMappedTable(originalCatalog, originalSchema, originalTable, null, originalTable);

                     if (action == null)
                        throw new Exception(ME + ".store: row with no action invoked '" + row.toXml("", true, false, true));
                     int count = modifyColumnsIfNecessary(originalCatalog, originalSchema, originalTable, row);
                     if (count != 0) {
                        if (log.isLoggable(Level.FINE)) log.fine("modified '" + count  + "' entries");
                     }
                     if (log.isLoggable(Level.FINE)) log.fine("store: " + row.toXml("", true, true, true));
View Full Code Here

                        throw new Exception(ME + ".store: row with no action invoked '" + row.toXml("", true, false, true));
                     int count = modifyColumnsIfNecessary(originalCatalog, originalSchema, originalTable, row);
                     if (count != 0) {
                        if (log.isLoggable(Level.FINE)) log.fine("modified '" + count  + "' entries");
                     }
                     if (log.isLoggable(Level.FINE)) log.fine("store: " + row.toXml("", true, true, true));
                     SqlDescription desc = getTableDescription(catalog, schema, table, conn);
                     boolean process = true;
                     if (this.prePostStatement != null) // row is the modified column name
                        process = this.prePostStatement.preStatement(action, conn, dbInfo, desc, row);
                     if (process) {
View Full Code Here

     
      assertEquals("the caseSensitive has been modified", true, sqlRow.isCaseSensitive());
      assertEquals("The value of the attribute has been modified", "value1", sqlRow.getAttribute("attr1").getStringValue());
      assertEquals("The value of the row has been modified", "valDummy1", sqlRow.getColumn("dummy1").getStringValue());
     
      log.info(row2.toXml(""));
      assertEquals("the caseSensitive has been modified", false, row2.isCaseSensitive());
      assertEquals("The value of the attribute has been modified", "newValue1", row2.getAttribute("attr1").getStringValue());
      Object obj = row2.getColumn("dummy1");
      assertNull("The value of the row has been modified", obj);
      assertEquals("The value of the row has been modified", "valDummy1", row2.getColumn("newDummy1").getStringValue());
View Full Code Here

            parser.init(info);
            SqlInfo sqlInfo = parser.parse(xmlTxt);
            List rows = sqlInfo.getRows();
            assertEquals("The number of rows is wrong", 1, rows.size());
            SqlRow row = (SqlRow)rows.get(0);
            log.info(row.toXml(""));
            row.renameColumn(oldName, newName);
            log.info(row.toXml(""));
         }
         catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

            List rows = sqlInfo.getRows();
            assertEquals("The number of rows is wrong", 1, rows.size());
            SqlRow row = (SqlRow)rows.get(0);
            log.info(row.toXml(""));
            row.renameColumn(oldName, newName);
            log.info(row.toXml(""));
         }
         catch (Exception ex) {
            ex.printStackTrace();
            assertTrue("An Exception should not occur when testing renaming of columns " + ex.getMessage(), false);
         }
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.