【发布时间】:2015-11-23 01:20:07
【问题描述】:
我想从名为 Image 的表和名为 image 且类型为 blob 的列中检索图像,但是在运行代码时,它会给出这样的 blob 代码 -
“oracle.sql.BLOB@193242d”
请参阅我的代码以获取并在 jsp 页面/浏览器上显示图像:-
ResultSet resultset =
statement.executeQuery("select * from image where id = '" + id + "'") ;
浏览器页面:-
<TABLE border="1">
<TR>
<TH>ID</TH>
<TH>picture</TH>
</TR>
<TR>
<TD> <%= resultset.getString(1) %> </TD>
<TD> <%= resultset.getBlob(2) %> </TD>
</TR>
</TABLE>
<BR>
【问题讨论】:
-
尝试使用
resultSet.getBinaryStream().