getBinaryStream("Image")报IOException 大家遇见过这个问题吗?
private InputStream selectImage(long id){
Connection conn=null;
PreparedStatement stmt=null;
ResultSet rs=null;
InputStream ins=null;
try{
conn = setConnection();
String Sql="select name,image,id from image where id=?";
stmt = conn.prepareStatement(Sql);
stmt.setLong(1,id);
rs=stmt.executeQuery();
while(rs.next()){
ins=rs.getBinaryStream("image");
}
}catch(Exception e){
System.out.println("Image.selectImage.error."+e.toString());
}
finally{
return ins;
}
}
Image 列为Image类型,id是自增型主键,不知道为什么,用getBinaryStream()取Image列的时候,总是报java.io.IOException: JZ0I9: 该 InputStream 已关闭,多谢大家能指点一二!