Attaching documents

I am going to create an application which I can attach any file to my application.it is the same as attaching docs.in emails.But once I attach and submit it I want to save the attached document to SQL database so I can retrieve it when ever i needed.

Basically i am thinking of having 2 buttons,one called"attach" ,other "submit"

would someone be able to help me with writting the code?Once the file get saved,i also want to display it in the page.(list of all

attachments in the DB).

I am not even sure if i can save any file to the DB.what type of field name will it be?

Is it possible to do this using just java/javascript ?

Please help

[683 byte] By [kuhasaa] at [2007-11-26 14:53:50]
# 1
saving a file to a database is a database specific issue.You have to research what your database supports, in terms of saving files to it. If you want to save it in the database there is nothing Java or Javascript can do that will change the behaviour of your database.
discussjava.com_a at 2007-7-8 8:42:13 > top of Java-index,Java Essentials,New To Java...
# 2
To save a file to database you will be using a CLOB/BLOB column. Most databases have BLOB support.Look up blob+jdbc for examples.Like discussjava.com_ says, what options available to you depend on your database.Ted..
ted_trippina at 2007-7-8 8:42:13 > top of Java-index,Java Essentials,New To Java...