Saving an Image object in JDBC

I

Ike

Does anyone have any clue how to save and retrieve an Image object under
JDBC ? //Ike
 
T

Tim Jowers

Marco Schmidt said:
xp comp.lang.java.databases,comp.lang.java.programmer
fup2 comp.lang.java.programmer

Ike:


Which only copies a binary file into a BLOB column, it does not, as
you asked, work on an Image object.

Do you mean the binary data of the image cannot be saved into the db?
I had a problem like this saving class files in a database. If I
remember, the solution is to use base64 or uuencode etc. as the db
does not truly support binary. Like many things, BLOB was a false and
misleading acronym. I was developing on Access (argh!) and then we
were running on Teradata. Worked on production but not development :)

Tim
 
M

Marco Schmidt

xp comp.lang.java.databases,comp.lang.java.programmer
fup2 comp.lang.java.programmer

Please regard the followup-to!

Tim Jowers:
Do you mean the binary data of the image cannot be saved into the db?

No, I mean that in this particular example nobody is working on a
java.awt.Image object but they are copying the original image file
data into the database. Which is fine, but in some cases there may not
be such a file, because the image was generated in the program, or
acquired from a scanner. In those cases it is necessary to access the
raw image data, which is not possible with java.awt.Image itself. In
addition, it may make a lot of sense to first convert the raw image
data into some compressed form in order to save disk space.

There are certain pitfalls to consider when converting Image to BLOB,
that's all I'm saying.

[...]

Regards,
Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top