File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

store pdf on file to another file

 
krishna prakash
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually my problem is I want to store the pdf file in database as a blob.and i want to retrieve the pdf file ,how can i do ?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The general approach would be to read the file into a byte[] (using the FileInputStream class), and then use that with the Blob and PreparedStatement classes for inserting it into the DB.

For retrieving it from the DB you'd call ResultSet.getBlob, and then use FileOutputStream to store it in a file.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic