This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes save jpeg in mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "save jpeg in mysql" Watch "save jpeg in mysql" New topic
Author

save jpeg in mysql

ramandeep singh
Greenhorn

Joined: Jan 16, 2007
Posts: 13
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
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

I found something related with your query to storing jpeg files into MySQL database
see this link hope it helps..


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: save jpeg in mysql
 
Similar Threads
ActionMessages & logic:messagesPresent
saveErrors is deprecated
How to display Error Messages in Action class to the User
"The import org.apache.struts.action" can not be Resolved
save jpeg in mysql using struts