In order to upload a file, the form needs to have
enctype="multipart/form-data".
In order to process such a form on the server side, it's easiest to use a library that handles parsing the request parameters, for example, the
Apache Commons FileUpload library.
The filename sent with the form is the name of the file
on the client--in other words, if I'm upload a file to your site, the filename sent by my browser will be the filename on *my* system. It may or may not include complete path information (again, on *my* machine)--that behavior depends on the browser. The name of the file on *my* machine is useless to you.
Your application, on the *server* side, should save the file locally. *That* filename, including the path, is what
you should store in your database, and use an image servlet as previously mentioned to send it back to a client. I'm not a fan of storing the images themselves in the database.