[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: jdbc/informix/pdf question



couple of months ago somebody had posted a similar question about streaming the PDF on AJUG. It might help if you search in AJUG's archive.
If this is an internal application setting content-type to application/pdf and streaming the contents of the PDF might be more than good enough.
-Vikrant


-----Original Message-----
From: Jones, Ashley C [mailto:Ashley.Jones@bellsouth.com]
Sent: Wednesday, June 11, 2003 4:44 PM
To: ajug-members@ajug.org
Subject: jdbc/informix/pdf question



OK Interesting situation here and I'm not really sure how to begin so I
thought
this might make an interesting discussion.

I'm rewriting an interface to an informix database.  In this database are
records which
contain attachments in pdf format.  These attachments are stored in the
database as Type
Informix byte.

for example

Column name		Type		Nulls
----------------------------------------------------------------------------
colname1		varchar(25)	no
colname2		varchar(25)	no
attachment_name	varchar(5)	no
attachment		byte		yes

In the Informix Driver JDBC Docs there is a IfxTypes.IFX_TYPE_BYTE

What I would like to do is when someone wants to view the attachment have it
queried from the
database and then imbedded into a browser window for viewing.  From there
the user can close
or save the file.

The way it is done now in the previous application is the file is extracted
to a temporary directory
on the server and using anonymous ftp it is viewed by the user.

Has anyone done anything like this before?

I'm thinking that I can use ResultSet.getBinaryStream() to retrieve the data
from the database and read it into
a File object.  From their send it to be embedded in a browser window( not
sure how to do this part )  

Thks
Ashley Jones
BellSouth




*****
"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential, proprietary, and/or
privileged material.  Any review, retransmission, dissemination or other use
of, or taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.  If you received
this in error, please contact the sender and delete the material from all
computers."