• 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

save jpeg in mysql using struts

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am making struts application in which i need to put .jpeg image,resume.doc or resume.rtf file in to Mysql database
how can i do tht ,
i tried setBlob(byte[])
and
try {

pst.setBinaryStream(18,form.getpic().getInputStream());
} catch (FileNotFoundException ex) {
errors.add("sqlError",new ActionMessage("errors.resume.emptyfile"));
} catch (IOException ex) {
errors.add("sqlError",new ActionMessage("errors.resume.emptyfile"));
}
but they are causing exceptions ,can i also save the .doc file in same format and how to download them
[ January 18, 2007: Message edited by: ramandeep singh ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This link has a good example of reading from and writing to a BLOB.
 
reply
    Bookmark Topic Watch Topic
  • New Topic