It's possible that URL doesn't point to your servlet correctly. It's possible that the SQL query doesn't select any rows. It's possible that your database code throws an exception. I'm sure there are other possibilities. So given all of that, it would help if you explained exactly what you see instead of just saying you don't get the image. You might also want to review the server logs and debug your servlet code to see what, if any, lines of code are being executed.
As Paul pointed out, most likely the URL is invalid. Do a View Source of the page and cut/paste the URL of the image tag into the browser address bar. Does the image appear? If not, the URL is not correct.