Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes uploading a word doc/excel files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "uploading a word doc/excel files " Watch "uploading a word doc/excel files " New topic
Author

uploading a word doc/excel files

Bala'J'i Rags
Greenhorn

Joined: Jul 29, 2008
Posts: 26
I am working on a application which has an requirement like uploading a word/excel document into a database table from a jsp view using hibernate or JDBC API .(Like the user browses the file to upload and clicks on a upload button).Can anyone help me with some suggestion and tips on the ways to upload /download documents to a table.


Thanks in advance..
[ December 04, 2008: Message edited by: Bala'J'i Rags ]

SCJP 1.5,SCWCD 1.5
Bala'J'i
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
What do you have so far? Is the problem the uploading of the file to the servlet container, or the saving of the uploaded file to the database?


Ping & DNS - my free Android networking tools app
Bala'J'i Rags
Greenhorn

Joined: Jul 29, 2008
Posts: 26
It focuses on saving the file in an oracle table..Sorry if the post was ambiguios
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
You can use an attribute of type BLOB to store binary data in a database. JDBC supports this through the setBlob and setBinaryStream methods in PreparedStatement, and the getBinaryStream in ResultSet.

I generally advise against storing files in a database. I'd store them somewhere in the file system, and just keep the filename and directory information in the database.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: uploading a word doc/excel files