Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java EE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 小弟跪求如何用jspsmartUpload组件oracle中保存的文件
zhaolu





发贴: 2
积分: 0
于 2007-06-01 16:55 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我是这样写的,但是执行到mySmartUpload.downloadField(rs,"d_dfnrfj","application/x-msdownload", filename);这步就不行了,请高手指点,谢谢!
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" %>
<%@ page import="java.sql.*,com.jspsmart.upload.*"%>
<%
  request.setCharacterEncoding("GBK");
  String fileId = request.getParameter("id");
  String driver = "oracle.jdbc.driver.OracleDriver";
  String url = "jdbc:oracle:thinAngrylocalhost:1521:xxx";
  String user = "scott";
  String passwd = "tiger";
  Connection conn = null;
  String id = request.getParameter("id");

  try{
      Class.forName(driver);
     conn = DriverManager.getConnection(url, user, passwd);
     Statement stmt = conn.createStatement();
      String sql = "SELECT * from d_ddmltzglfj ";
      ResultSet rs = stmt.executeQuery(sql);
      System.out.println("sql== " + sql);
      if (rs.next()){
        //Initialization
        
        SmartUpload mySmartUpload = new SmartUpload();
        
        mySmartUpload.initialize(config,request,response);
        mySmartUpload.setTotalMaxFileSize(200000);
        
//mySmartUpload.initialize(ctx);
      mySmartUpload.setContentDisposition(null);
      
//       Download field
      String filename = rs.getObject("d_dffile").toString();
      System.out.println("文件名====: " + filename) ;
      System.out.println("文件编码: " + System.getProperty("file.encoding"));

      
      
            mySmartUpload.downloadField(rs,"d_dfnrfj","application/x-msdownload", filename);
      
      }

      rs.close();
      stmt.close();
      conn.close();

    }
    catch(Exception e){
      
    }
    finally{
    }
    
  
  %>




Java应用者与<IDE/环境>

话题树型展开
人气 标题 作者 字数 发贴时间
9258 小弟跪求如何用jspsmartUpload组件oracle中保存的文件 zhaolu 1591 2007-06-01 16:55
7811 Re:小弟跪求如何用jspsmartUpload组件oracle中保存的文件 JJ_JJ 70 2007-06-10 14:22

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923