问题
Is it possible to store a Jpeg file in a database using a Web Application?
can you share some code on how to do it?
or share some links for some tutorial regarding with my problem? thanks a lot :)
回答1:
storing an image in a blob
i don't use java, i don't know what database structure you are using but the principle is to store the image in a binary large object. (blob) it does require reading the object in and out using streams. (or at least in c# this is the case)
the alternative(if it works) is to store a string location and have the image in a directory somewhere.
回答2:
BLOB data type, that is what u need.
and the link is ;)
blob google search
回答3:
This is not a good practice to store a jpeg file in database. Always store the file in related directories and store their paths in your database. If you are storing jpeg files in your database, then think about the size of your database if you are having 1 million records?
来源:https://stackoverflow.com/questions/5217180/how-to-store-a-jpeg-file-in-a-database