Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uploading xml to database

 
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
Marshal
Posts: 34839
369
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: 42968
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