Topic: 小弟跪求如何用jspsmartUpload组件oracle中保存的文件

  Print this page

1.小弟跪求如何用jspsmartUpload组件oracle中保存的文件 Copy to clipboard
Posted by: zhaolu
Posted on: 2007-06-01 16:55

我是这样写的,但是执行到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{
    }
    
  
  %>

2.Re:小弟跪求如何用jspsmartUpload组件oracle中保存的文件 [Re: zhaolu] Copy to clipboard
Posted by: JJ_JJ
Posted on: 2007-06-10 14:22

可以到http://www.java2s.com/Code/Oracle/CatalogOracle.htm 去看看,应该有你需要的相关信息


   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