query = substituteNSN((String) fileParameters_.get("classVData"), consumer_id); logger.debug("For ammo, use query " + query);
query = substituteNSN((String) fileParameters_.get("classVData"), consumer_id); if (logger.isDebugEnabled()) { logger.debug("For ammo, use query " + query); }
  protected String getNomenclature(String type_id, String type) {    String nomen = null;    logger.debug("getNomenclature() for type " + type_id);    Vector pgs = null;    // skip whole query process    if (type.equals("BulkPOL")) {      NewSupplyClassPG pg = PropertyGroupFactory.newSupplyClassPG();      pg.setSupplyClass("ClassIIIPOL");      pg.setSupplyType("BulkPOL");      pgs = new Vector();      pgs.add(pg);      propertyGroupTable.put(type_id, pgs);      return (String) fuelsNomenclature.get(type_id);    }    String consumer_id = type_id.substring(type_id.indexOf("/") + 1);    // create query    String query = null;    if (type.equals("Ammunition")) {      query = substituteNSN((String) fileParameters_.get("classVData"), consumer_id);      logger.debug("For ammo, use query " + query);    } else if (type.equals("Consumable")) {      //			query = substituteNSN ((String) fileParameters_.get ("classIXData"), consumer_id);      ////			query = substituteNSN ((String) fileParameters_.get ("ConsumableArmyNSN"), consumer_id);      // CDW: NSN for Hydraulic Fluid      //String my_consumer_id = "9150009857236";      // CDW: Original query and substitute      query = substituteNSN((String) fileParameters_.get("classIXData"), consumer_id);      // CDW: Uses NSN for Hydraulic Fluid      //query = "select nomenclature, ui, price, cube, weight from header where nsn='"+my_consumer_id+"'";      // CDW: Uses current NSN with the info for Hydraulic Fluid      //query = "select " + consumer_id + ", nomenclature from header where nsn='"+my_consumer_id+"'";      logger.debug("For consumable, use query " + query);    } else if (type.startsWith(MEIPrototypeProvider.LEVEL2)) {      pgs = addLevel2Pgs(type);      nomen = type + " asset";      if (pgs != null) {        propertyGroupTable.put (type_id, pgs);      }      return nomen;    } else if (type.equals("PackagedPOL")) {      query = substituteNSN((String) fileParameters_.get("classIIIPackagedData"), consumer_id);      logger.debug("For pack pol, use query " + query);    } else {      logger.error("getNomenclature(), unrecognized type " +                   type + " for " + consumer_id);      return null;    } // if    // if query not found, return null    if (query == null) {      logger.error("getConsumableNomenclature() Query not found for " + consumer_id);      return null;    } // if    // execute query    Vector result;    try {      result = executeQuery(query);    } catch (Exception ee) {      logger.error(          "getConsumableNomenclature(), DB query failed. query= " + query + "\n ERROR " + ee);      return null;    } // try    if (result.isEmpty()) {      // PAS not sure why, but this seems to be normal      logger.debug("getConsumableNomenclature() no result for " + type_id + " using " + query);      return null;    } else {      logger.debug("Got a result:" + result);    } // if    // parse results    Object row[] = (Object[]) result.firstElement();    nomen = (String) row[0];    if (type.equals("Ammunition")) {      pgs = parseAmmunitionRow(row);      logger.debug("adding pgs for ammo");    } else if (type.equals("Consumable")) {      pgs = parseConsumableRow(row);      logger.debug("adding pgs for consumable");    } else if (type.equals("PackagedPOL")) {      pgs = parsePackagedPOLRow(row);      logger.debug("adding pgs for pack pol");    } // if    if (pgs != null) {      propertyGroupTable.put(type_id, pgs);    } // if    logger.debug("returning nomen " + nomen);    return nomen;  } // getNomenclature