public String consultarImagen(
     Connection conn,
     String path,
     String pagina,
     String sucID,
     String vigID,
     String padreID,
     String secundarioID,
     String referenciaID,
     String documentoID,
     String consecutivoID) {
   Vector vRetornoImg = new Vector(1);
   Statement st = null;
   ResultSet rs = null;
   String sql = "";
   try {
     if (consecutivoID.length() <= 0) consecutivoID = "%";
     if (pagina.equalsIgnoreCase("prerequisitodet")) {
       sql =
           " select PREDI_IMAGEN img, PREDI_NOMBREIMAGEN nameimg"
               + " from COT_PREREQUISITODETIMG"
               + " where suc_id = '"
               + sucID
               + "' "
               + "   and vig_id = '"
               + vigID
               + "'"
               + "   and prec_id = '"
               + padreID
               + "'"
               + "   and tpr_id = '"
               + secundarioID
               + "'"
               + "   and tdo_referencia = '"
               + referenciaID
               + "'"
               + "   and tdo_id = '"
               + documentoID
               + "'"
               + "   and predi_consecutivo like '"
               + consecutivoID
               + "'";
     }
     if (pagina.equalsIgnoreCase("requisitosdis")) {
       sql =
           " select REDII_IMAGEN img, REDII_NOMBREIMAGEN nameimg"
               + " from COT_REQHABILITANTEDISIMG "
               + " where suc_id = '"
               + sucID
               + "' "
               + "   and vig_id = '"
               + vigID
               + "'"
               + "   and disc_id = '"
               + padreID
               + "'"
               + "   and tdo_referencia = '"
               + referenciaID
               + "'"
               + "   and tdo_id = '"
               + documentoID
               + "'";
     }
     if (pagina.equalsIgnoreCase("proceso")) {
       sql =
           " select PROEI_IMAGEN img, PROEI_NOMBREIMAGEN nameimg"
               + " from COT_PROCESOESTIMG "
               + " where suc_id = '"
               + sucID
               + "' "
               + "   and vig_id = '"
               + vigID
               + "'"
               + "   and proc_id = '"
               + padreID
               + "'"
               + "   and epo_id = '"
               + secundarioID
               + "'"
               + "   and tdo_referencia = '"
               + referenciaID
               + "'"
               + "   and tdo_id = '"
               + documentoID
               + "'"
               + "   and proei_consecutivo like '"
               + consecutivoID
               + "'";
     }
     st = conn.createStatement();
     rs = st.executeQuery(sql);
     if (rs.next()) {
       vRetornoImg.clear();
       vRetornoImg.addElement(rs.getBlob("img"));
       vRetornoImg.addElement(rs.getString("nameimg"));
       return famhn.upload.central.FileUpload.materializarImagen(path + "/", conn, vRetornoImg);
     }
     return "Pendiente";
   } catch (Exception e) {
     System.out.println("" + e.toString());
     return e.toString();
   } finally {
     try {
       rs.close();
       rs = null;
     } catch (Exception er) {;
     }
     try {
       st.close();
       st = null;
     } catch (Exception err) {;
     }
   }
 }