dragon2733
Programmer
I need to read a blob from the oracle database and display it as a PDF. I have included the code I am using, however, I am getting a nullpointer exception when trying to write the blob. What am I missing? Is there a better way to do this? Thanks!
InputStream inStrm = null;
OutputStream outStrm = null;
Blob custBlob = pdfBlob.getBlob(); // get blob from db
inStrm = custBlob.getBinaryStream();
byte[] bytes = new byte[(int)custBlob.length()];
inStrm.read(bytes);
outStrm.write(bytes);
outStrm.flush();
outStrm.close();
inStrm.close();
InputStream inStrm = null;
OutputStream outStrm = null;
Blob custBlob = pdfBlob.getBlob(); // get blob from db
inStrm = custBlob.getBinaryStream();
byte[] bytes = new byte[(int)custBlob.length()];
inStrm.read(bytes);
outStrm.write(bytes);
outStrm.flush();
outStrm.close();
inStrm.close();