Hi,
I have recently done what you are looking for using (not surprisingly if you
take a look at my e-mail) an Informix database. I stored the images as blobs in
the database and used a singleton class (called through a JSP custom tag) to
retrieve the images to the file system and manage a cache which can be easily
configured (size of the cache area and time before an image expires). Informix
provides a function called blobtofile which makes if very easy to transfer the
file from the database to the filesystem. This allows me to bypass the jdbc
calls which are slower. You should however be able to do something similar with
a java database like InstantDB (I am not sure about Hypersonic, since I have
never used it). By storing the image inside a database you make sure that you
maintain the data integrity and the cache allows you to get file system like
performance.
The result is a clean readable code in the JSP page. Here is an example:
<ip:DownloadFromDB table="vs_images" column="image"
indexColumn="content_id" index="<%=document.getId()%>" indexColumn2="order"
index2="1" fromCache="false">
<ip:Success name="file"
type="InstantPortal.ImageFile">
<IMG SRC="<%=file.getImageURL()%>">
</ip:Success>
<ip:NoResults>
Empty
</ip:NoResults>
</ip:DownloadFromDB>
Regards,
Huibert
[EMAIL PROTECTED] wrote:
> Hi:
>
> How about creating an object that first deletes the image file referenced in
> the database then deletes the record itself?
>
> Stefan