编写上传文件代码时候出错:
1:Hibernate: select user0_.id as id5_, user0_.username as username5_, user0_.password as password5_, user0_.email as email5_, user0_.tel as tel5_ from shop.user user0_ where user0_.username=?
java.io.FileNotFoundException: E:\workspace\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\tomcat\webapps\shopping\upload\p.gif (系统找不到指定的路径。)哪个倒2的\upload是我指定的保存图片的文件夹。好像是文件夹路径找不到的问题,那应该把它放在哪里(我是放在工程目录下)。
2:Hibernate: insert into shop.product (name, userid, fkind, skind, image, intro, number, upload_time, price) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
2009-9-6 15:29:41 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'image' at row 1。
听说是数据库编码的问题,我还没有运用中文功能,jsp页面都是用utf-8编码,而且也把mysql数据库中的my.ini里面改成utf-8,是哪里还需要改正吗?

解决方案 »

  1.   

    Data too long for column 'image' at row 1字段image宽度设置的太小了!
      

  2.   

    放在工程目录下没有问题,eclipse自动生成一个虚拟目录来存放文件,也就是E:\workspace\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\tomcat\webapps\
    只有当你打var包运行时才会是真正的项目路径
    user0_.username=? 
    不知道楼主注意没?
      

  3.   

    楼上的朋友想说什么?不太明白。你是说把目录放在E:\workspace\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\tomcat\webapps\ 
    这里吗?user0_username=?是编码出错吗?