I would start by making a
servlet that can stream binary data to a browser.
Have it accept an ID for the image in your database as a form parameter, querystring variable, or part of the URL.
Then write an object that can pull the image data from the database and return it to your servlet for streaming.
Note: Don't try to stream binary data from a JSP.
JSP wasn't meant to do that sort of thing and you'll save yourself a lot of headaches if you start out building it as a servlet.
I have a sample app that covers some of what you'll need to do.
http://simple.souther.us Look for SimpleStream.
It reads the images from file but it wouldn't be difficult to modify it to read from a database instead.