aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Uploading xml to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Uploading xml to database" Watch "Uploading xml to database" New topic
Author

Uploading xml to database

Smita Talawadekar
Greenhorn

Joined: Jan 21, 2008
Posts: 9
Hello all,

Can anyone tell me how to upload xml/pdf/txt file to database using hibernate/ejb/jdbc or any other way? please explain using sample code or example....

thanks in advance...
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30938
    
158

The first step is to create a BLOB data type. (for PDF) or CLOB (XML or Text) Then take a look at the JDBC tutorial for how to insert it.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
rex hindlekar
Greenhorn

Joined: Feb 25, 2010
Posts: 16
You could also use API such as POI/IText/PDFOne/PDFBox or Spring framework which has these code.

Jeanne is right about the JDBC calls to put into the Blob objects in the DB.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42620
    
  65
You could also use API such as POI/IText/PDFOne/PDFBox or Spring framework which has these code.

None of these libraries has anything to do with storing a file in a DB (maybe Spring, very remotely) - they're used to create files.


Ping & DNS - my free Android networking tools app
rex hindlekar
Greenhorn

Joined: Feb 25, 2010
Posts: 16
Right Ulf.

Unless she uses the ready available files that are on the file system (local/remote machine)
 
Don't get me started about those stupid light bulbs.
 
subject: Uploading xml to database