db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Schmitt" <mi.schm...@gmx.de>
Subject How to read/write images to/from db
Date Wed, 19 Mar 2003 13:11:17 GMT
Hi,
probably, this is not the right mailing list for my question, but since I
use Torque to access the data, I hope that someone may answer my
question.
My schema schema definition looks something like this:
...
  <table name="item">
    <column name="id" required="true" type="INTEGER" primaryKey="true"/>
    ...
    <column name="picture" required="false" type="BLOB"/>
</table>
....
(db: MySql)

I want to write a JSP/Servlet (running on tomcat 4.1.18) that shows the
details
and the image of an 'Item'. But I don't know how to get the image from the
db.
Do I have to write a servlet that delivers the image? If so, how to write
it?
Also, I want to offer another JSP/HTML or whatever that enables a user to
upload the image. But I don't know to upload and how to write it to the db.
The
generated Java-class offers the method 'setPicture(byte[])', but where to
get the
byte[] from?

Any help will be welcomed,
michael


Mime
View raw message