how to store a file n retrieve a file from mysql database using jsp

sir,
I want to store into mysql database and retrieve it back from database using jsp..
wat data type should we use to store as such file in database and is there any source code available for tat in jsp?
sunda2010Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TeazerMDCommented:
Hello, you would need to create a field in your database for that.
MySQL has BLOB field type  which is used for storing files.
0
allen-davisCommented:
A blob will work but you should consider the performance impact and space requirements over time. Another option could be to write the file to the file system and then store the file path and information about the file (if you want) in the My SQL tables.
The drawback to using the file system and tables together would be when you need to clean up the files. You will need a process that reads the table then deletes the file from the file system.
0
sunda2010Author Commented:
is there any source code available to display the file content which is retrieved from the database in jsp/java
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

TeazerMDCommented:
I don't thinks so because you can store there any type of file, meanwhile the browser can display only some specific types of files. I would dare to say that the best you can find is a code that would return the file as a file-stream(so you can download the file).
0
siddagrlCommented:
0
siddagrlCommented:
0
sunda2010Author Commented:
is there any code available to  store a file into mysql db?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.