Package com.firefun.DAO

Examples of com.firefun.DAO.Result


      files.delFile(key_file);
    }
  }

  public boolean realDel(String delid) {
    Result rst = new Result("ffdb");

    String sql = "select ccmc from ff_upload where fileid='" + delid + "'";
    rst.EQuery(sql);
    String filename = rst.getString(0, "ccmc");
    delFile(filename);
    sql = "delete from ff_upload where fileid='" + delid + "'";
    return rst.EUpdate(sql);
  }
View Full Code Here


   * @author firefun
   * @version 1.0
   */
  public String getDBMess(Object obj, String ywid, String basepath) {
    String str_out = "";
    Result rst = new Result("ffdb");
    String sql = "select * from ff_upload where ywid ='" + ywid + "'";
    rst.EQuery(sql);
    for (int i = 0; i < rst.getRow(); i++) {
      str_out += "<tr>\n<td align=\"center\" class=\"mtabtab02\">"
          + rst.getString(i, "filemc") + "&nbsp;</td>\n";
      str_out += "<td align=\"center\" class=\"mtabtab02\">"
          + rst.getString(i, "filelx") + "&nbsp;</td>\n";
      str_out += "<td align=\"center\" class=\"mtabtab02\">"
          + rst.getString(i, "filesize") + "&nbsp;</td>\n";
      str_out += " <td align=\"center\" class=\"mtabtab02\"><a href=\""
          + basepath + "download?downid="
          + rst.getString(i, "fileid")
          + "\" target=\"_parent\">下载</a>\n";
      str_out += " <a href=\"ffupload.jsp?flag=realdel&ywid=" + ywid
          + "&delid=" + rst.getString(i, "fileid")
          + "\">/删除</a></td>\n</tr>\n";
    }
    String temp_str = getStMess(obj, ywid);
    return str_out + temp_str;
  }
View Full Code Here

    }
    return str_out;
  }

  public String getYwid(String ywid) {
    Result rst = new Result("ffdb");
    if ("".equals(ywid) || (ywid == null)) {
      // 文件id申请
      String sql = "select seq_ywid.nextval ywid from dual";
      rst.EQuery(sql);
      ywid = rst.getString(0, "ywid");
    }
    return ywid;
  }
View Full Code Here

    String filename = "";
    String filename_temp = "";
    String sql = "";
    String fileid = "";

    Result rst = new Result("ffdb");

    HttpSession session = request.getSession();
    Object obj = session.getAttribute("se_files" + ywid);
    // 获取用户信息
    UserInfo userinfo = (UserInfo) session.getAttribute("userInfo");
    String userid = userinfo.getUserID();
    String dwid = userinfo.getDwid();
    sql = "select sjdwid from sys_dept where dwid='" + dwid + "'";
    rst.EQuery(sql);
    String sjdwid = rst.getString(0, "sjdwid");

    if (obj != null) {
      Files files = (Files) obj;
      for (int i = 0; i < files.getCount(); i++) {
        com.firefun.FileUpload.File myFile = files.getFile(i);
        if (!myFile.isMissing()) {
          sql = "select SEQ_FF_UPLOAD.Nextval fileid from dual";
          rst.EQuery(sql);
          fileid = rst.getString(0, "fileid");
          // 增加更名
          randomString = RandomString.getDBCode();
          filename = myFile.getFileName();
          /*
           * filename_temp = filename.substring(0, filename
           * .lastIndexOf(".") - 1) + randomString +
           * filename.substring(filename.lastIndexOf("."));
           */
          filename_temp = fileid + randomString
              + filename.substring(filename.lastIndexOf("."));
          // System.out.println(filename_temp);
          StringBuffer stringBuffer = new StringBuffer();
          stringBuffer
              .append("insert into ff_upload (fileid,filemc,ccmc,filelx,sfyx,ywid,filesize,contenttype,dwid,userid,sjdwid,zlss) values ('"
                  + fileid + "','");
          stringBuffer.append(myFile.getFileName());
          stringBuffer.append("','");
          stringBuffer.append(filename_temp);
          stringBuffer.append("','");
          stringBuffer.append(myFile.getFileExt());
          stringBuffer.append("','1','");
          stringBuffer.append(ywid);
          stringBuffer.append("','");
          stringBuffer.append(myFile.getSize());
          stringBuffer.append("','");
          stringBuffer.append(myFile.getContentType());
          stringBuffer.append("','");
          stringBuffer.append(dwid);
          stringBuffer.append("','");
          stringBuffer.append(userid);
          stringBuffer.append("','");
          stringBuffer.append(sjdwid);
          stringBuffer.append("','");
          stringBuffer.append(sslx);
          stringBuffer.append("')");
          // 数据库记录
          // System.out.println(stringBuffer.toString());
          rst.EUpdate(stringBuffer.toString());
          Address adress = new Address();
          String path = adress.getAddress().replace("WEB-INF", "")
              + "upload/" + filename_temp;
          myFile.saveAs(path);
          if (uploadmodel.equals("1")) {
            continue;
          } else if (uploadmodel.equals("2")) {
            System.out.println("%%%%%%%%%%%%" + path);
            rst.EUpdateBlob("ff_upload", "b_file", "fileid",
                fileid, path);
            delFile(filename_temp);
          } else {
            System.out.println("%%%%%%%%%%%%" + path);
            rst.EUpdateBlob("ff_upload", "b_file", "fileid",
                fileid, path);
          }
        }
      }
    }
View Full Code Here

  }

  public void download(String downid, String path) throws IOException {
    FileOutputStream fileoutstream = new FileOutputStream(path);
    String b_file = "";
    Result rst = new Result("ffdb");
    String sql = "select b_file from ff_upload where fileid='" + downid
        + "'";
    rst.EQuery(sql);
    if (rst.getRow() > 0) {
      b_file = rst.getString(0, "b_file");
    }
    byte[] bs = b_file.getBytes();
    fileoutstream.write(bs);
    fileoutstream.flush();
    fileoutstream.close();
View Full Code Here

        SmartUpload mySmartUpload = new SmartUpload();
        //String ccmc = request.getParameter("ccmc");
        //String contenttype = request.getParameter("contenttype");
        //String filemc = request.getParameter("filemc");
        String downid = request.getParameter("downid");
        Result rst = new Result("ffdb");
    String sql = "select * from ff_upload where fileid ='" + downid + "'";
    rst.EQuery(sql);
    String ccmc = rst.getString(0,"ccmc");
        String contenttype = rst.getString(0,"contenttype");
        String filemc = rst.getString(0,"filemc");
   
        String path = Address.getAddress().replace("WEB-INF","")+ "upload/" + ccmc;
        FileUtil util = new FileUtil();
        //System.out.println("%%%%%%%%%%"+util.uploadmodel);
        try
View Full Code Here

TOP

Related Classes of com.firefun.DAO.Result

Copyright © 2018 www.massapicom. 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.