您的位置:首页 > 数据库 > Oracle

hibernate 保存图片到数据库(oracle)

2015-08-17 08:48 387 查看
String picPath = request.getSession().getAttribute("picPath").toString();
picPath = request.getSession().getServletContext().getRealPath(File.separator) +picPath;
FileInputStream fileInputStream = new FileInputStream(picPath);
xhcxGrsqEntity.setGrsqIdph(Hibernate.createBlob(fileInputStream));

//其中bean对应的字段类型定义为:
//java.sql.Blob
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: