If you are trying to write both bits at he same time (ie read from db and convert into ImageIcon), do them one at a time first.
Probably read the byte stream and dump it to either standard out or a file. If you dump it to a file
you should be able to load it in a viewer.
After you know this is working, debug the ImageIcon bit. I've had problems with ImageIcon before when trying to do two things at one with it.