rc = (RecipeComponent) con.newInstance(new Object[] {rs.getString(2), getRecipeAssembly(conn, substitutions)});
rc = (RecipeComponent) con.newInstance(new Object[] {rs.getString(2), getRecipeAssembly(conn, substitutions), recipeId});
  protected RecipeComponent getDatabaseRecipe(String recipeId,                                              String recipeName) {    createLogger();        String query = null;    RecipeComponent rc = null;    try {      Connection conn = DBUtils.getConnection();      try {        Map substitutions = new HashMap();        substitutions.put(":recipe_id", recipeId);        Statement stmt = conn.createStatement();        query = DBUtils.getQuery("queryRecipe", substitutions);        ResultSet rs = stmt.executeQuery(query);        if (rs.next()) {          if(isComplexRecipe(conn, substitutions)) {            if(log.isDebugEnabled()) {              log.debug("Creating Complex Recipe from Database");            }            String assemblyId = getRecipeAssembly(conn, substitutions);            if(assemblyId == null) {              if(log.isErrorEnabled()) {                log.error("Cannot locate proper assemblyId loading Recipe.  Load Failed");              }              return null;            }            Constructor con = null;            try {              Class cls = Class.forName(rs.getString(3));              Class[] args = {String.class, String.class};              con = cls.getConstructor(new Class[] {String.class, String.class});                          } catch(Exception e) {              if(log.isErrorEnabled()) {                log.error("Error constructing recipe from database.  Load Failed.", e);              }              return null;            }                        try {              rc = (RecipeComponent) con.newInstance(new Object[] {rs.getString(2), getRecipeAssembly(conn, substitutions)});            } catch(Exception ee) {              if(log.isErrorEnabled()) {                log.error("Error creating recipe instance", ee);              }              return null;            }            rc.initProperties();            return rc;          } else {            if(log.isDebugEnabled()) {              log.debug("Creating Simple Recipe from Database");            }            try {              DbRecipe dbRecipe = new DbRecipe(rs.getString(2), Class.forName(rs.getString(3)));              getRecipeProperties(dbRecipe, conn, substitutions);              dbRecipe.name = recipeName;              rc = organizer.getRecipe(dbRecipe.name);              if (rc == null) {                rc = createRecipe(dbRecipe.name, dbRecipe.cls);                setRecipeComponentProperties(dbRecipe, rc);                rc.saveToDatabase();              }              return rc;            } catch (ClassNotFoundException cnfe) {              if(log.isErrorEnabled()) {                log.error("for recipe", cnfe);              }            }          }        }        if(rc == null && log.isErrorEnabled()) {          log.error("Recipe not found: " + recipeId);        }        rs.close();        stmt.close();      } finally {        conn.close();      }    } catch (SQLException se) {      if(log.isErrorEnabled()) {        log.error("Caught SQL exception getting DBRecipe " + query, se);      }    }        return rc;  }