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. Advertising

  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. Advertising

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,178
  2. Roedy Green
    Replies:
    0
    Views:
    1,523
    Roedy Green
    Jul 23, 2009
  3. sahm
    Replies:
    4
    Views:
    885
  4. Ricardo Pog
    Replies:
    1
    Views:
    491
    Austin Ziegler
    Mar 26, 2008
  5. Sean Nakasone
    Replies:
    1
    Views:
    431
    Farrel Lifson
    Apr 14, 2008
Loading...

Share This Page