public void add(){
UploadFile file = getFile("file");
byte[] bytes = {};
if (file != null) {
bytes = FileUtils.getBytes(file.getFile());
}
//许可证号
String xkzh01 = this.getPara("XKZH01");
String xkzh02 = this.getPara("XKZH02");
String xkzh = "TS"+xkzh01+"-"+xkzh02;
//检验单位ID
String jyUnitID = ((SysUser)this.getSession().getAttribute("_user")).getUnitid();
DictJysq jysq = getModel(DictJysq.class, "jysq");
jysq.setXKZH(xkzh);
jysq.setJYUnitID(jyUnitID);
jysq.setSQRQ(new Date());
//这个字段为blob类型
jysq.setLicImage(bytes);
jysq.save();
renderNull();
}
存入之前的bytes 数组的字节数为:879394
图片大小没有超过1m的
在执行sql语句后 报错:2017-09-20 14:55:33