videos in blobs

is it a good idea to store videos in mysql blobs?thanks
[69 byte] By [amrishkra] at [2007-11-27 3:56:14]
# 1

Look to the benefits in terms of portability, manageability, upgradeability, etc and compare it with the lecacy filesystem.

You could also consider a combination of the both worlds, storing filecontents in the filesystem and storing filedetails (filename, filelength, mimetype, etc) in the database.

BalusCa at 2007-7-12 9:00:26 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
hi thanks for replyingwat would you suggest ....shud i go for blobs or shud i go for jakarta common file upload?thanks again
amrishkra at 2007-7-12 9:00:26 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

I don't know what your (future) requirements are. It's your application and your decision. I already have given you some pointers to think about.

By the way, even if you use blobs, you should still use commons fileupload. How else would you capture the binary stream from the uploaded file? The commons fileupload is not intented to be able to write a file, there the Sun's Java IO API is sufficient for.

BalusCa at 2007-7-12 9:00:26 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
hi thanksi m a novice...can u plz help me with it.how can i use Sun IO api to do it ?
amrishkra at 2007-7-12 9:00:26 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

Face it: with the commons fileupload API you can capture the file contents from a multipart form submit. With this API you can put the file contents in a byte array (or an inputstream). Nothing more or less.

Once you have got the byte array (or the inputstream), you can use the java.io API to write it to the filesystem. Or you use java.sql API (JDBC) to write it into the database. The commons fileupload API doesn't do that all for you.

Just read the API documentation here at sun.com and it's tutorials how to use those API's.

http://www.google.com/search?q=java+io+api+site:sun.com

http://www.google.com/search?q=java+io+tutorial+site:sun.com

http://www.google.com/search?q=java+sql+api+site:sun.com

http://www.google.com/search?q=jdbc+tutorial+site:sun.com

BalusCa at 2007-7-12 9:00:26 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 6
thanks a lot
amrishkra at 2007-7-12 9:00:26 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...