Re: How to insert PDF file in to MySql and read it from MySql toJAVA App

Discussion in 'Java' started by Jeffrey H. Coffield, Jul 23, 2009.

  1. sahm wrote:
    > Hi every one
    > How can I insert PDF file in to MySql Database and read it to My JAVA
    > App and print it.
    >
    > Best
    > Salim


    This can be done by using a blob field in MySQL and a variation of the
    code at

    https://pdf-renderer.dev.java.net/examples.html

    But consider what it can do to backing up the database. Usually PDF
    documents are archive data and as such the database will grow to be
    quite large and each new insert can lead to having to back up the entire
    database. Storing the PDF files on a regular web server and just storing
    the URL makes the MySQL database much smaller and easier to back up. It
    is then easy to do an incremental backup of the real PDF's.

    Obviously this is a generalization and may not apply to your situation.

    Jeff Coffield
    www.digitalsynergyinc.com
     
    Jeffrey H. Coffield, Jul 23, 2009
    #1
    1. Advertisements

  2. Jeffrey H. Coffield

    Lew Guest

    Jeffrey H. Coffield wrote:
    >
    > sahm wrote:
    >> Hi every one
    >> How can I insert PDF file in to MySql Database and read it to My JAVA
    >> App and print it.
    >>
    >> Best
    >> Salim

    >
    > This can be done by using a blob field in MySQL and a variation of the
    > code at
    >
    > https://pdf-renderer.dev.java.net/examples.html
    >
    > But consider what it can do to backing up the database. Usually PDF
    > documents are archive data and as such the database will grow to be
    > quite large and each new insert can lead to having to back up the entire
    > database. Storing the PDF files on a regular web server and just storing
    > the URL makes the MySQL database much smaller and easier to back up. It
    > is then easy to do an incremental backup of the real PDF's.


    OTOH, if the URL for the PDF (or other binaries such as PNG or TIFF files) is
    on the local system, a backup and restore of a database might result in broken
    links. This will not be a problem if the binaries are stored as BLOBs.

    The point of backups is not to reduce the space or time they take, but to
    increase the usefulness of the restore process. The fastest, leanest backup
    in the world does no good if the restored data are corrupt.

    --
    Lew
     
    Lew, Jul 24, 2009
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JL
    Replies:
    0
    Views:
    1,307
  2. Alex Smith
    Replies:
    0
    Views:
    662
    Alex Smith
    Jun 15, 2005
  3. MacRules
    Replies:
    0
    Views:
    883
    MacRules
    Aug 22, 2009
  4. sahm
    Replies:
    4
    Views:
    1,091
  5. julian
    Replies:
    8
    Views:
    719
    Avatar
    Apr 6, 2006
  6. Ricardo Pog
    Replies:
    1
    Views:
    780
    Austin Ziegler
    Mar 26, 2008
  7. Sean Nakasone
    Replies:
    1
    Views:
    660
    Farrel Lifson
    Apr 14, 2008
  8. Alex Dowad
    Replies:
    4
    Views:
    667
    Michel Demazure
    May 1, 2010
Loading...