You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Sh...@stpaul.com on 2002/05/16 17:51:56 UTC

PDF from FOP to database as BLOB

Hi,

Currently we are dynamically creating our PDF documents using FOP in
real-time and displaying them on the browser without a problem.  We've
handled the CPU intensiveness of FOP by limiting the number of users that
can concurrently create a report to 1 or 2 (depending on the server).

BUT - As the number of users requesting PDF reports on our application
scales up we'll need a better solution.  Since our users can wait for these
reports we've decided to run a nightly job to create them and store the
PDFs in our database as a BLOB.  That way during peak usage hours our
servers will only need to deal with returning the PDF to the browser.

My question is, HOW, using FOP and JDBC can I get my PDF into the database
as a BLOB.
The java.sql.PreparedStatement method setBinaryStream(int parameterIndex,
InputStreamx, int length) requires an input stream - how can I get this
from FOP?  If I instead us the java.sql.PreparedStatement method setBlob
(int i, Blob x) method - how can I create a BLOB from what I have from FOP?


Any Ideas would be very helpful.
Thank You!
Shawn


Re: PDF from FOP to database as BLOB

Posted by Lee Goddard <ho...@LeeGoddard.com>.
At 10:51 16/05/2002 -0500, Shawn.Lindstrom@stpaul.com wrote:

>... Since our users can wait for these
>reports we've decided to run a nightly job to create them and store the
>PDFs in our database as a BLOB.  That way during peak usage hours our
>servers will only need to deal with returning the PDF to the browser.
>
>...My question is, HOW, using FOP and JDBC can I get my PDF into the 
>database as a BLOB.
>
>Any Ideas would be very helpful.

I worked on a project like that. One big question:
what is wrong with a file system?  In other words, why
tax a database with such a heavy load, when you can
use the Apache HTTPD. Just write a little Perl to convert
the docs as they come in, and put them in an obvious place,
and add them to an index page in good old HTML.  Or, if
you really wanna use that DB, index their URI and attributes.

Or is there a good reason why not? (Like, you work for Oracle...)

Lee


Lee Goddard
perl -e "while(1){print rand>0.5?chr 47:chr 92}"