Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> retrive and display PDF file

retrive and display PDF file

From: Jian Cheng <jcheng01_at_rochester.rr.com>
Date: Wed, 13 Jun 2001 02:15:02 GMT
Message-ID: <G0AV6.14593$3y3.3220730@typhoon.nyroc.rr.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US