コード例 #1
0
 @Override
 public void setInfo(
     Map<String, String[]> p, String id, List<? extends SharedObjectInterface> databases) {
   databaseMeta =
       DatabaseMeta.findDatabase(
           (List<DatabaseMeta>) databases,
           BaseStepMeta.parameterToLong(p.get(id + ".connection")));
   rowLimit = BaseStepMeta.parameterToInt(p.get(id + ".rowLimit"));
   sql = BaseStepMeta.parameterToString(p.get(id + ".sql"));
   outerJoin = BaseStepMeta.parameterToBoolean(p.get(id + ".outerJoin"));
   replacevars = BaseStepMeta.parameterToBoolean(p.get(id + ".replacevars"));
   sqlfieldname = BaseStepMeta.parameterToString(p.get(id + ".sqlfieldname"));
   queryonlyonchange = BaseStepMeta.parameterToBoolean(p.get(id + ".queryonlyonchange"));
 }
コード例 #2
0
 public void readRep(
     Repository rep, long id_step, List<DatabaseMeta> databases, Map<String, Counter> counters)
     throws KettleException {
   try {
     long id_connection = rep.getStepAttributeInteger(id_step, "id_connection"); // $NON-NLS-1$
     databaseMeta = DatabaseMeta.findDatabase(databases, id_connection);
     rowLimit = (int) rep.getStepAttributeInteger(id_step, "rowlimit"); // $NON-NLS-1$
     sql = rep.getStepAttributeString(id_step, "sql"); // $NON-NLS-1$
     outerJoin = rep.getStepAttributeBoolean(id_step, "outer_join"); // $NON-NLS-1$
     replacevars = rep.getStepAttributeBoolean(id_step, "replace_vars");
     sqlfieldname = rep.getStepAttributeString(id_step, "sql_fieldname"); // $NON-NLS-1$
     queryonlyonchange =
         rep.getStepAttributeBoolean(id_step, "query_only_on_change"); // $NON-NLS-1$
   } catch (Exception e) {
     throw new KettleException(
         Messages.getString("DynamicSQLRowMeta.Exception.UnexpectedErrorReadingStepInfo"),
         e); //$NON-NLS-1$
   }
 }
コード例 #3
0
  private void readData(Node stepnode, List<DatabaseMeta> databases) throws KettleXMLException {
    try {
      String con = XMLHandler.getTagValue(stepnode, "connection"); // $NON-NLS-1$
      databaseMeta = DatabaseMeta.findDatabase(databases, con);
      sql = XMLHandler.getTagValue(stepnode, "sql"); // $NON-NLS-1$
      outerJoin =
          "Y"
              .equalsIgnoreCase(
                  XMLHandler.getTagValue(stepnode, "outer_join")); // $NON-NLS-1$ //$NON-NLS-2$
      replacevars = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "replace_vars"));
      queryonlyonchange =
          "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "query_only_on_change"));

      rowLimit = Const.toInt(XMLHandler.getTagValue(stepnode, "rowlimit"), 0); // $NON-NLS-1$
      sqlfieldname = XMLHandler.getTagValue(stepnode, "sql_fieldname"); // $NON-NLS-1$

    } catch (Exception e) {
      throw new KettleXMLException(
          Messages.getString("DynamicSQLRowMeta.Exception.UnableToLoadStepInfo"), e); // $NON-NLS-1$
    }
  }