Load PDF to DB2

Akash Pilot

Load PDF to DB2
Esteemed Listers,
I want to load a PDF file into a DB2 table (as a BLOB). Could somebody tell me
how to accomplish this? I would like to know how to convert the PDF file into a
format that DB2 could use for loading. The environment is DB2 V8 on z/OS.

TIA!
Akash

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Phil Grainger

Re: Load PDF to DB2
(in response to Akash Pilot)
Hi Akash

Not sure what you mean by "convert" - if you are loading a BLOB then ANY (big) sequence of bits is a valid input data chunk

The only think you need to be concious of is that whatever you are using to get the PDF out of DB2 again to display (as a PDF file) knows how (or if) it has been converted on the way IN to DB2

Otherwise you just Load your PDF into a LOB column

Phil Grainger
CA

________________________________

From: DB2 Data Base Discussion List on behalf of Akash Pilot
Sent: Tue 25/11/2008 18:23
To: [login to unmask email]
Subject: [DB2-L] Load PDF to DB2



Esteemed Listers,
I want to load a PDF file into a DB2 table (as a BLOB). Could somebody tell me
how to accomplish this? I would like to know how to convert the PDF file into a
format that DB2 could use for loading. The environment is DB2 V8 on z/OS.

TIA!
Akash

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms




______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Akash Pilot

Re: Load PDF to DB2
(in response to Phil Grainger)
Hi Phil,
Thanks for your response. I guess I should have asked - do I need to convert
the PDF to any particular format before I load. Apparently I don't.

I intend to use Java to fetch and display the file on the web.

Thanks again!
Akash

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Peter Vanroose

Re: Load PDF to DB2
(in response to Akash Pilot)
Indeed, no conversions needed.
A BLOB has no codepage (CCSID) associated to it, as opposed to a CLOB.
So no automatic conversions will happen: not on input from Java to DB2 and
not on output from DB2 to Java.

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Douwe van Sluis

Re: Load PDF to DB2
(in response to Peter Vanroose)
Akash,

Make sure you understand how BLOB are stored physically. Depending on
the DB2 version you might run in to challenges. But these challenges can
be solved. Search the DB2-L for threads about this.
Like Phil already explained you don't need to convert, you probably
don't want to convert.
Have a close look at the zparms LOBVALA and LOBVALS. Since PDF can
become large, a default value for these parms probably won't do.
Don't be afraid to experiment. LOBs in DB2 for z/OS work great.
We have implemented a archiving system with BLOBs. The size is now about
4 TB and still performs unimaginable fast.
In DB2 V9 space management of LOBs is finally there.
Have fun.

Vriendelijke groet,
Douwe van Sluis




-----Oorspronkelijk bericht-----
Van: DB2 Data Base Discussion List [mailto:[login to unmask email] Namens
Akash Pilot
Verzonden: dinsdag 25 november 2008 20:55
Aan: [login to unmask email]
Onderwerp: Re: [DB2-L] Load PDF to DB2


Hi Phil,
Thanks for your response. I guess I should have asked - do I need to
convert
the PDF to any particular format before I load. Apparently I don't.

I intend to use Java to fetch and display the file on the web.

Thanks again!
Akash

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The
DB2-L list archives, FAQ, and delivery preferences are at
http://www.idug.org/lsidug under the Listserv tab. While at the site,
you can also access the IDUG Online Learning Center, Tech Library and
Code Place, see the latest IDUG conference information and much more.
If you have not yet signed up for Basic Membership in IDUG, available at
no cost, click on Member Services at http://www.idug.org/lsms

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Victor Bond

Re: Load PDF to DB2
(in response to Douwe van Sluis)
We have an app that stores PDF or DOC files in a BLOB. Works great. We
had to have a flag to indicate which it was so we can put the correct
extension on it when we pull it out (couldn't figure out how to tell
without the flag.) One of the main things is to determine the max size
of the document so that you can size the blob.
Thanks,
Victor

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Peter Vanroose
Sent: Tuesday, November 25, 2008 12:47 PM
To: [login to unmask email]
Subject: Re: [DB2-L] Load PDF to DB2

Indeed, no conversions needed.
A BLOB has no codepage (CCSID) associated to it, as opposed to a CLOB.
So no automatic conversions will happen: not on input from Java to DB2
and
not on output from DB2 to Java.

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The
DB2-L list archives, FAQ, and delivery preferences are at
http://www.idug.org/lsidug under the Listserv tab. While at the site,
you can also access the IDUG Online Learning Center, Tech Library and
Code Place, see the latest IDUG conference information and much more.
If you have not yet signed up for Basic Membership in IDUG, available at
no cost, click on Member Services at http://www.idug.org/lsms

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms