<分区>
我在数据库中有一个表。在该表中,一个字段的类型为 BLOB,其中包含图像。我想从数据库中读取相同的图像,并希望通过使用标记在 jsp 页面上显示图像。
//在jsp中使用代码是
<%
Blob image;
image=blogd.getImage();
out.println(image);
%>
<img src="<%=image.getBinaryStream() %>>" width="300px" height="300px" />
// out.println(image);
output of this particular line is
org.hibernate.lob.SerializableBlob@c7014c
- blogd 是 Persitance java 类的对象。