Posted By:
Chandra_Patni
Posted On:
Monday, February 18, 2002 07:48 PM
It is possible. The following example illustrates it.
ResultSet rs = ...
Blob b = rs.getBlob(1);
//response.resetBuffer(); // we are still not 2.3
response.reset();
java.io.OutputStream strms = response.getOutputStream();
response.setContentType("application/pdf");
int size = 8092;
BufferedInputStream is = new BufferedInputStream(b.getBinaryStream(), size);
int n = 0;
byte bytes[] = new byte[size];
while((n = is.read(bytes, 0, size)) > 0) {
strms.write(bytes, 0, n);
}
%>