• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Saving Doc as BLOB in SQL DB

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

I made a JFileChooser, so that you can select only textual documents, and then I want to be able to save this to a database but I really have no idea of where to start with BLOBs can someone give me a little starting push with this topic...I read examples online about how to retrieve BLOBS which seemed very easy...I am jsut not sure how to save a document as a BLOB to begin with..this is the code for my filechooser incase you wanted to see it:



Just so you know, I do know how to write to the DB, I just don't know how to handle BLOBs. Any help at all would be appreciated, =)

Thanks,
Michael
[ April 23, 2008: Message edited by: Michael Paul ]
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Michael,
The key is to create a binary input stream rather than a blob and call stmt.setBinaryStream().
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic