Saving a PDF file to DB2

Jane Leyba

Saving a PDF file to DB2
Greetings,

My management team is starting to think creatively and have asked the
following question:

Can you save a PDF file to a DB2 table? The DB2 table will then be
accessed by Lotus Notes and subsequently accessed via the internet for use
by our customers.

Since we have no experience (or knowledge) in this area, Does anyone have
any experience with this concept? Can you explain briefly how this might
work and where we might obtain some information on the specifics?

Thanks!





Jane Leyba
IDUG 2006 NACPC
Networking Chairman
ISS, Inc.
Manager, Business Support
(847) 553-3642

---------------------------------------------------------------------------
The information transmitted (including any attachments) is the property of
Property Casualty Insurers Association of America (PCI) or its affiliates,
Independent Statistical Service, Inc. (ISS) and Association of California
Insurance Companies (ACIC). It is intended only for the person or entity
to which it is addressed and may contain proprietary, business,
confidential, privileged and/or copyrighted material. Any unauthorized
use, retention, dissemination, forwarding, printing, or copying of this
e-mail or any attachments in whole or in part is strictly prohibited. If
you have received this e-mail by mistake please notify the sender by
return e-mail and delete this from your system. Please note that e-mails
are susceptible to change, PCI and its affiliates, ISS and ACIC, shall not
be liable for the improper or incomplete transmission of the information
contained in this communication nor for any delay in its receipt or damage
to your system. PCI, ISS and ACIC do not guarantee that the integrity of
this communication has been maintained or that this communication is free
of viruses, interceptions or interference.

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Wayne Driscoll

Re: Saving a PDF file to DB2
(in response to Jane Leyba)
Jane,
You have a couple of options. The first would be to use a BLOB object to
store the file, with one row per pdf file. For lotus notes use this would
probably be best, although there are numerous operational concerns over the
use of BLOB's in DB2 (search to archives for the past 3-4 weeks for
discussions). A second option, which will require programming work to
return the file as one piece would be to store the data in table such as the
following:

create table pdf_table (
file_name char(100),
seq_num integer,
file_chunk long varchar for bit data
)

This table would be in a 32k tablespace, and you would have to break the
file into chunks, when you save it and reassemble it via an order by on the
seq_num. This would be more work on the application side, but will be much
easier for operational work, especially if the pdf files are dynamic.

Hope this helps
Wayne Driscoll
Product Developer
JME Software LLC
NOTE: All opinions are strictly my own.



________________________________

From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf
Of Jane Leyba-Midwest UG Leader
Sent: Wednesday, January 11, 2006 7:37 PM
To: [login to unmask email]
Subject: [DB2-L] Saving a PDF file to DB2



Greetings,

My management team is starting to think creatively and have asked the
following question:

Can you save a PDF file to a DB2 table? The DB2 table will then be accessed
by Lotus Notes and subsequently accessed via the internet for use by our
customers.

Since we have no experience (or knowledge) in this area, Does anyone have
any experience with this concept? Can you explain briefly how this might
work and where we might obtain some information on the specifics?

Thanks!





Jane Leyba
IDUG 2006 NACPC
Networking Chairman
ISS, Inc.
Manager, Business Support
(847) 553-3642

---------------------------------------------------------------------------
The information transmitted (including any attachments) is the property of
Property Casualty Insurers Association of America (PCI) or its affiliates,
Independent Statistical Service, Inc. (ISS) and Association of California
Insurance Companies (ACIC). It is intended only for the person or entity to
which it is addressed and may contain proprietary, business, confidential,
privileged and/or copyrighted material. Any unauthorized use, retention,
dissemination, forwarding, printing, or copying of this e-mail or any
attachments in whole or in part is strictly prohibited. If you have
received this e-mail by mistake please notify the sender by return e-mail
and delete this from your system. Please note that e-mails are susceptible
to change, PCI and its affiliates, ISS and ACIC, shall not be liable for the
improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
PCI, ISS and ACIC do not guarantee that the integrity of this communication
has been maintained or that this communication is free of viruses,
interceptions or interference.
----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". The IDUG DB2-L FAQ is at
http://www.idugdb2-l.org. The IDUG List Admins can be reached at
[login to unmask email] Find out the latest on IDUG conferences at
http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Phil Jackson

Re: Saving a PDF file to DB2
(in response to Wayne Driscoll)
We've stored images as BLOBs in DB2 UDB with really no problem. As a test I
even stored an mp3 and was able to stream it from DB2.

A typical structure was:

Table blobstuff
ID int identity
Filename char(50)
Mime_type char(50)
The_blob blob(some large number here)

The key is to store it's http content-type when it is uploaded. Have a
"helper" app that you link to as in:
<img src="blobserver.asp?ID=378">
Blobserver.asp reads that row, sets it's content-type accordingly, and
binary writes out the blob. Your browser reads the content type http header
and calls the appropriate software to render it.

I seem to recall that there is actually an extended tablespace used for the
blob portion and a regular tablespace used for the rest.

Phil J.


Jane,
You have a couple of options. The first would be to use a BLOB object to
store the file, with one row per pdf file. For lotus notes use this would
probably be best, although there are numerous operational concerns over the
use of BLOB's in DB2 (search to archives for the past 3-4 weeks for
discussions). A second option, which will require programming work to
return the file as one piece would be to store the data in table such as the
following:

create table pdf_table (
file_name char(100),
seq_num integer,
file_chunk long varchar for bit data
)

This table would be in a 32k tablespace, and you would have to break the
file into chunks, when you save it and reassemble it via an order by on the
seq_num. This would be more work on the application side, but will be much
easier for operational work, especially if the pdf files are dynamic.

Hope this helps
Wayne Driscoll
Product Developer
JME Software LLC
NOTE: All opinions are strictly my own.



________________________________

From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf
Of Jane Leyba-Midwest UG Leader
Sent: Wednesday, January 11, 2006 7:37 PM
To: [login to unmask email]
Subject: [DB2-L] Saving a PDF file to DB2



Greetings,

My management team is starting to think creatively and have asked the
following question:

Can you save a PDF file to a DB2 table? The DB2 table will then be accessed
by Lotus Notes and subsequently accessed via the internet for use by our
customers.

Since we have no experience (or knowledge) in this area, Does anyone have
any experience with this concept? Can you explain briefly how this might
work and where we might obtain some information on the specifics?

Thanks!





Jane Leyba
IDUG 2006 NACPC
Networking Chairman
ISS, Inc.
Manager, Business Support
(847) 553-3642

---------------------------------------------------------------------------
The information transmitted (including any attachments) is the property of
Property Casualty Insurers Association of America (PCI) or its affiliates,
Independent Statistical Service, Inc. (ISS) and Association of California
Insurance Companies (ACIC). It is intended only for the person or entity to
which it is addressed and may contain proprietary, business, confidential,
privileged and/or copyrighted material. Any unauthorized use, retention,
dissemination, forwarding, printing, or copying of this e-mail or any
attachments in whole or in part is strictly prohibited. If you have
received this e-mail by mistake please notify the sender by return e-mail
and delete this from your system. Please note that e-mails are susceptible
to change, PCI and its affiliates, ISS and ACIC, shall not be liable for the
improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
PCI, ISS and ACIC do not guarantee that the integrity of this communication
has been maintained or that this communication is free of viruses,
interceptions or interference.
----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". The IDUG DB2-L FAQ is at
http://www.idugdb2-l.org. The IDUG List Admins can be reached at
[login to unmask email] Find out the latest on IDUG conferences at
http://conferences.idug.org/index.cfm

----------------------------------------------------------------------------
-----
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home
page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select
"Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org.
The IDUG List Admins can be reached at [login to unmask email] Find
out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Cristian Molaro

Re: Saving a PDF file to DB2
(in response to Phil Jackson)
Hi Jane,

Do you know the redbook http://www.redbooks.ibm.com/redbooks/SG246571?
Could be of great help if you decide to go for LOBs and DB2 for zOS ...

Have a nice day,
Cristian Molaro
MConsulting.be


On Wed, 11 Jan 2006 19:37:13 -0600, Jane Leyba-Midwest UG Leader
<[login to unmask email]> wrote:

>Greetings,
>
>My management team is starting to think creatively and have asked the
>following question:
>
>Can you save a PDF file to a DB2 table? The DB2 table will then be
>accessed by Lotus Notes and subsequently accessed via the internet for use
>by our customers.
>
>Since we have no experience (or knowledge) in this area, Does anyone have
>any experience with this concept? Can you explain briefly how this might
>work and where we might obtain some information on the specifics?
>
>Thanks!
>
>
>
>
>
>Jane Leyba
>IDUG 2006 NACPC
>Networking Chairman
>ISS, Inc.
>Manager, Business Support
>(847) 553-3642
>
>---------------------------------------------------------------------------
>The information transmitted (including any attachments) is the property of
>Property Casualty Insurers Association of America (PCI) or its affiliates,
>Independent Statistical Service, Inc. (ISS) and Association of California
>Insurance Companies (ACIC). It is intended only for the person or entity
>to which it is addressed and may contain proprietary, business,
>confidential, privileged and/or copyrighted material. Any unauthorized
>use, retention, dissemination, forwarding, printing, or copying of this
>e-mail or any attachments in whole or in part is strictly prohibited. If
>you have received this e-mail by mistake please notify the sender by
>return e-mail and delete this from your system. Please note that e-mails
>are susceptible to change, PCI and its affiliates, ISS and ACIC, shall not
>be liable for the improper or incomplete transmission of the information
>contained in this communication nor for any delay in its receipt or damage
>to your system. PCI, ISS and ACIC do not guarantee that the integrity of
>this communication has been maintained or that this communication is free
>of viruses, interceptions or interference.
>
>---------------------------------------------------------------------------------
>Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home
page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select
"Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org.
The IDUG List Admins can be reached at [login to unmask email] Find
out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Abe Kornelis

Re: Saving a PDF file to DB2
(in response to Cristian Molaro)
Jane, Wayne,

Cutting up an object into pieces and reassembling upon retrieval is
certainly possible. Db2's Content Management product does exactly that.
(AFAIK it was written before LOBs became avbailable).

The approach has a drawback, however: it will log all updates to pdf
stored by writing complete before and after images to the log. You may
want to increase active log dataset size before you start storing any
significant number of pdfs or other LOB-type data into rows.

OTOH, the advantages are a.o. that data can be accessed more easily
than LOB data. And - at least when using CM - the software cuts the
data into chunks of up to nearly 4K for 'small-ish' objects and up to
nearly 32K for 'large-ish' objects.

Success!
Abe Kornelis.
============

Jane Leyba asked

Can you save a PDF file to a DB2 table? The DB2 table will then be accessed
by Lotus Notes and subsequently accessed via the internet for use by our
customers.

Wayne Driscoll replied:
... break the file into chunks, when you save it and reassemble it via an order by on the seq_num...

Abe Kornelis

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm