1 Reply Latest reply on Nov 27, 2002 5:36 AM by colinws

    saving images in Oracle

    mkent

      If this is the wrong place to post this request, then please direct me to the proper forum.

      I'm trying to determine the best way to save product catalog images in Oracle8i for various clients. We would prefer to save the images in the database internally rather than simply storing URL links to the files on a webserver. I know this involves additional overhead, but I'd like to see if anyone has done this already with JBoss3 and/or could point me to an online document showing the steps to make this happen.

      We are using the JBoss-3.0.2_Tomcat-4.0.4 bundle. Thanks!

        • 1. Re: saving images in Oracle

          I did this (for documents, rather than images, but exactly the same otherwise), by having a Document entity bean, which stored information about the file I was storing (such as it's name, size, mime-type, etc), and a DOCUMENT_DATA table in Oracle with a BLOB column that held the raw bytes of the file.

          I chose this way so that I could do all the management stuff through EJB and CMR, but the BLOB stuff can't be done in EJB.

          Connect the two halves by the same ID, and do servlet and JDBC stuff to retrieve the blob data when it's time to show it.

          If you're uploading data, you'll need to do Oracle specific stuff if your fiels get over 4K. This is only a few extra lines of code though.