This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Uploading xml to database  RSS feed

 
Smita Talawadekar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 36396
453
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
rex hindlekar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
rex hindlekar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right Ulf.

Unless she uses the ready available files that are on the file system (local/remote machine)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!