• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Add Video file to database

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to create a database where i can store my video files.. After creation, i want to upload and download these video files from my database from a jsp page... How do i implement this procedure?
 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not placing your videos as files somewhere so each video file has a unique URL and you can store these URLs in the database?
 
Irwin Raja
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if i consider storing url's, then wen a user uploads a file i wont be able to access it as my database would have only url nd not the actual file..
 
Devaka Cooray
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does that mean you are not able to access the URLs given in the database?
 
Irwin Raja
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can access the url's.. but wen a user uploads a file from his system i would be having the path of the file defined in his system rather than the actual file in my databse..
 
Saloon Keeper
Posts: 7585
176
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe the term "URL" threw you off a bit. What Devaka meant was that you'd store the videos in the file system, and keep only the path to each file in the DB, along with any other metadata about the video in question. Storing actual video data in the DB is probably not the right way to do it.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyway, databases don't store huge objects such as video files inside the database table structure, that would render table manipulation very very very slow - instead, large objects are stored as separate files with references in the actual database tables.

Bill
 
Ranch Hand
Posts: 42
Hibernate Oracle Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its as simple as this:
Step 1: The end-user submits his file to your system (for how to upload a file in Java you can find lots of examples on Google).
Step 2: You can use your File Api to store/refer/delete that file on your server at the same time store the path of the file in your database column.

and when the user want to retrieve it you are now referring to the file in your server not in the end user machine.

As Tim and William said it is not advisable to store entire file in the database.
 
Irwin Raja
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot..
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic