日期:2014-05-17 浏览次数:20746 次
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String FileType=request.getContentType();
System.out.println(FileType);
String img=request.getParameter("Photo");
System.out.println(img);
String sql="update EMP_TES set(Photo) values(?) where epmno = 7369";
try{
File file = new File(img);
FileInputStream str=new FileInputStream(img);
System.out.println(str.available());
PreparedStatement ps=cn.prepareStatement(sql);
ps.setBinaryStream(1,str,str.available());
ps.executeUpdate();
ps.close();
}catch(Exception e){
System.out.println("取得记录错误:"+e.getMessage());
}
}