Hibernate向数据库中插入Blob的类型对象时,报错如图,跪求指点 5
也许图片看不清不插入Blob的时候是正常运行的插入后就报错啦@TestpublicvoidtestWriteBlob()throwsException{Studentss...
也许图片看不清 不插入Blob的时候是正常运行的 插入后 就报错啦
@Test
public void testWriteBlob() throws Exception {
Students s = new Students();
File f = new File("/Users/chenbin/百度云同步盘/照片/人物志/陈彬/IMG_0080.jpg");
FileInputStream is = new FileInputStream(f);
Blob image = Hibernate.getLobCreator(session).createBlob(is,
is.available());
s.setSname("张三丰");
s.setGender("男");
s.setBirthday(new java.util.Date());
s.setAddress("武当山");
s.setPhoto(image);
session.save(s);
is.close();
}
} 展开
@Test
public void testWriteBlob() throws Exception {
Students s = new Students();
File f = new File("/Users/chenbin/百度云同步盘/照片/人物志/陈彬/IMG_0080.jpg");
FileInputStream is = new FileInputStream(f);
Blob image = Hibernate.getLobCreator(session).createBlob(is,
is.available());
s.setSname("张三丰");
s.setGender("男");
s.setBirthday(new java.util.Date());
s.setAddress("武当山");
s.setPhoto(image);
session.save(s);
is.close();
}
} 展开
2015-09-27
展开全部
private function loaderHandler(event:*):void {
switch(event.type) {
case Event.COMPLETE:
trace(_loader.data.result);
break;
case Event.OPEN:
trace("open: " + event);
break;
case ProgressEvent.PROGRESS:
trace("progress: " + event);
break;
switch(event.type) {
case Event.COMPLETE:
trace(_loader.data.result);
break;
case Event.OPEN:
trace("open: " + event);
break;
case ProgressEvent.PROGRESS:
trace("progress: " + event);
break;
追问
谢谢,不过我还没有学Spring,我在上面那些是根据慕课网上学的,可是他能运行成功,我这边却报错
java.lang.AbstractMethodError: Method com/mysql/jdbc/PreparedStatement.setBinaryStream(ILjava/io/InputStream;J)V is abstract
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询