Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

save jpeg in mysql using struts

 
ramandeep singh
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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 ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This link has a good example of reading from and writing to a BLOB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic