Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> retrive and display PDF file
I am trying to write a java program to retrieve a PDF file stored in a LONG RAW column in Oracle and then save the file to local file system. The problem is the file can not been displayed within Acrobat Reader. Any advices will be appreciated.
Here is part of the code:
if (myResultSet.next ())
{
// Get the PDF data as a Stream from Oracle to the client
InputStream PdfData = myResultSet.getBinaryStream (columnName);
// Open a file to store the PDF data
FileOutputStream file = new FileOutputStream ("Data.pdf");
// Loop, reading from the stream and writing to the file
int c;
while ((c = PdfData.read ()) != -1)
file.write (c);
// Close the file
file.close ();
Jim Received on Tue Jun 12 2001 - 21:15:02 CDT
![]() |
![]() |