How i can save icon in blob?

hi all,I need save icon in blob column(desktop client with EJB). How i can do it? Please show me anybody example.
[127 byte] By [3eBCa] at [2007-11-27 8:36:58]
# 1

Well, every time I've used an icon, I've only really been interested in the image it contained, so I would store that in the database.

If you read it off disk somewhere, or from another stream, then you can syphon off a copy of that stream into a byte[], and store that in the db using ByteArrayOutputStream. This is good for efficiency in some cases.

Alternatively, if you only have and instance of Image, then you might try getting a binary input stream to the database, then writing it in png format, since it is lossless, using ImageIO.write( stream, "png" ) or something like that (can't remember exactly !)

so yeah.

Thats my suggestions :P

BobJandala at 2007-7-12 20:34:06 > top of Java-index,Java Essentials,Java Programming...
# 2
thanks
3eBCa at 2007-7-12 20:34:06 > top of Java-index,Java Essentials,Java Programming...