Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2003
    Posts
    20

    Question Unanswered: how to store a Word doc in DB2?

    Hello!

    How can i insert in a column from a table some documents like Word .doc or .pdf or .jpg. ?
    When i write a "select doc from ... where id=... " i wish to get the doc which i store in the database.
    Which is the easier mode to do that?


    Thank you.

  2. #2
    Join Date
    Jun 2003
    Location
    İstanbul
    Posts
    19

    Re: how to store a Word doc in DB2?

    Hi sorinc,

    I'm not a DB2 or database expert, so I cannot give you the exact answer for your question but I can tell what we are doing in an application we are working on.

    We have created tables that has columns with the data type BLOB and we save files like .doc, .pdf, .jpg.. etc in these columns as binary data. We are using Java code to insert and read the files. I don't know if there is any possibility to insert/read these files by using SQL statements.

    In the redbook Application Decvelopment Guide: Chapter 13, you can find more explanation about using LOB.

    If you are interested, I can post the Java source code we use for inserting files into database and reading them.
    Kezban

  3. #3
    Join Date
    Sep 2003
    Posts
    20

    Post

    Hi.

    Thank you very much for your answer. I'm very interesting in what you said. If you can, please, post the Java source code.
    Where can i download this redbook?


    Thank you.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You can download Redbooks at:
    http://www.redbooks.ibm.com/

  5. #5
    Join Date
    Jun 2003
    Location
    İstanbul
    Posts
    19
    Hi,

    I had found some sample code in IBM's web site, that was a good beginning for understanding the structure for inserting and reading BLOB data. Address of the page is below. Two zip files, WriteBlob.zip and GetBlob.zip are what you need. I think this will be more useful than our Java source code since our application's structure is more complex than the samples.

    About the Application Develompent Guide; I have the PDF version but I think it is also available online. You can find it by using a search engine like Google.

    DB2 sample code page:
    http://www.developer.ibm.com/tech/sampdb2.html
    Kezban

  6. #6
    Join Date
    Sep 2003
    Posts
    20

    Post

    Hello!

    thanks for your answer

    can you tell me where can i download the pdf or where can i find this guide?

  7. #7
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You can find a link to the IBM manuals in the thread above entitled "Useful DB2 Stuff."

    If you use the version of Acrobat reader that allows text searches, it makes using the IBM PDF manuals much easier. If you use an FTP program to retrieve the manuals, you can download an entire directory at once with all the relevent manuals for your version/release.

  8. #8
    Join Date
    Feb 2002
    Location
    Minneapolis, MN
    Posts
    253

    Re: how to store a Word doc in DB2?

    Kezban:

    Been looking for the Redbook you mentioned below and can't find any that are titled Application Development. Could you be a little more specific as to where this info is?

    Thanks!



    Originally posted by KezbanB
    Hi sorinc,

    I'm not a DB2 or database expert, so I cannot give you the exact answer for your question but I can tell what we are doing in an application we are working on.

    We have created tables that has columns with the data type BLOB and we save files like .doc, .pdf, .jpg.. etc in these columns as binary data. We are using Java code to insert and read the files. I don't know if there is any possibility to insert/read these files by using SQL statements.

    In the redbook Application Decvelopment Guide: Chapter 13, you can find more explanation about using LOB.

    If you are interested, I can post the Java source code we use for inserting files into database and reading them.
    Anthony Robinson

    "If I'm curt with you, it's because time is a factor here. I think fast, I talk fast, and I need you guys to act fast if you want to get out of this. So, pretty please - with sugar on top..."

  9. #9
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    I believe he is referring to a manual, not a Redbook:

    Application Development Guide: Building and Running Applications Version 8 SC09-4825-00
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  10. #10
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    You can download books at DB2 Technical Support page.

    Hope this helps,
    Grofaty

  11. #11
    Join Date
    Jun 2003
    Location
    İstanbul
    Posts
    19

    Re: how to store a Word doc in DB2?

    I have found a copy of Application Development Guide from this address (Chapter 13 is about LOBs.):
    www.mycore.de/library/db2/DB2A0E70.PDF

    And this is the online version of it (Using Large Objects (LOBs)):
    https://aurora.vcu.edu/db2help/db2a0/frame3.htm#db2a080


    Originally posted by ansonee
    Kezban:

    Been looking for the Redbook you mentioned below and can't find any that are titled Application Development. Could you be a little more specific as to where this info is?

    Thanks!
    Kezban

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •