用JspSmartUpload上传图片到指定文件,并截取图片名称存入sql server2000数据库,要怎么弄啊
用JspSmartUpload上传图片到指定文件,并截取图片名称存入数据库,要怎么弄啊   
 最好有代码   谢谢大侠
------解决方案--------------------package jspsmart_fileload_test;   
 import javax.servlet.*; 
 import javax.servlet.http.*; 
 import 
java.io.IOException; 
 import java.io.PrintWriter; 
 import java.util.*; 
 import com.jspsmart.upload.*;   
 /** 
 *  <p> Title:  </p>  
 *  <p> Description: 附件是带有 jspsmart 包,现在那个网站已经不能下载了所以这里给出  </p>  
 *  <p> Copyright: Copyright (c) 2004 </p>  
 *  <p> Company:  </p>  
 * @author wdz123@hotmail.com 
 * @version 1.0 
 */     
 public class JspSmartUploadSaveServlet extends HttpServlet { 
 private static final String CONTENT_TYPE =  "text/html; charset=GBK "; 
 private static final String SAVE_DIR_PATH =  "C:\\UPLOAD\\ ";//你可以修改这个设置,以保存到另外的目录 
 //Initialize global variables 
 public void init() throws 
ServletException { 
 }   
 //Process the HTTP Get request 
 public void doGet(HttpServletRequest request, HttpServletResponse response) throws 
 ServletException, 
IOException { 
 response.setContentType(CONTENT_TYPE); 
 PrintWriter out = response.getWriter(); 
 out.println( " <html>  "); 
 out.println( " <head>  <title> JspSmartUploadSaveServlet </title>  </head>  "); 
 out.println( " <body bgcolor=\ "#ffffff\ ">  "); 
 out.println( " <p> The servlet has received a  " + request.getMethod() + 
  ". This is the reply. </p>  "); 
 out.println( " </body>  "); 
 out.println( " </html>  "); 
 out.close(); 
 }   
 //Process the HTTP Post request 
 public void doPost(HttpServletRequest request, HttpServletResponse response) throws 
 ServletException, IOException { 
 PrintWriter out = response.getWriter(); 
 response.setContentType(CONTENT_TYPE);  
 out.println( " <html>  "); 
 out.println( " <head>  <title> JspSmartUploadSaveServlet </title>  </head>  "); 
 out.println( " <body bgcolor=\ "#ffffff\ ">  "); 
 saveFile(request, response, out); 
 out.println( " <p> 文件保存完成  " + request.getMethod() + 
  ". <a href=\ "jspFileLoad.jsp\ "> 继续上传文件 </a>  </p>  "); 
 out.println( " </body>  "); 
 out.println( " </html>  "); 
 out.close(); 
 }   
 private void saveFile(HttpServletRequest request, 
 HttpServletResponse response, PrintWriter out) { 
 //上传的文件个数 
 int count = 0; 
 //文件描述 
 String FileDescription[] = {null, null, null}; 
 SmartUpload mySmartUpload = new SmartUpload();   
 ServletConfig servletConfig = getServletConfig(); 
 try { 
 //SmartUpload之初始化,一定要初始化才可以使用 
 mySmartUpload.initialize(servletConfig, request, response); 
 //进行相应处理 
 mySmartUpload.upload(); 
 //最大文件//20mb 
 mySmartUpload.setMaxFileSize(20 * 1024 * 1024); 
 } catch (Exception e) { 
 }   
 //判断有沒有文件描述 
 //有保存这些信息 
 //沒有丟入空白字串 
 if (mySmartUpload.getRequest().getParameter( "File1 ") != null) { 
 FileDescription[0] = mySmartUpload.getRequest().getParameter( 
  "File1 "); 
 } else { 
 FileDescription[0] =  " ";