Do you like storing images in SQL database BLOBs? I love it... :-)
Long time ago I wrote a simple Delphi app which stored images in a Firebird SQL database. My database is still there, but I don't have Delphi anymore... :-)
So, I tried to do it in Java using Firebird's JayBird JDBC/JCA driver. The documentation provides two examples on how to insert data to a BLOB column in a table and how to load them back, but I couldn't make the examples compile with Java 2 SDK 1.4.2_05. As a true Java newbie I derived a new class BlobImage.java
right from the java.lang.Object
, added some code.... Maybe you'll find it useful.
Note that you will need BlobContentType
interface, too. Finally, there is a javadoc for the class.