File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes how to insert image into mySql database 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 "how to insert image into mySql database" Watch "how to insert image into mySql database" New topic

how to insert image into mySql database

Bee Ho

Joined: Feb 04, 2004
Posts: 1
hi everybody,
i would like to ask how to insert image into mysql database. I try to think a method for solving the problems. the method is that creating a ejb bean with image setter and getter. the setter and getter are with Ojbect type for parameter and return.
in fact, setting the setter and getter with parameter type and return type as string type that is right or not.
besides, i would like to ask how to get a image from local directory by using front end function based on Strut technology.
Best regard,
Bee Ho
Sergiu Truta
Ranch Hand

Joined: Dec 16, 2003
Posts: 121
First of all you should make sure that MySQL (and the version you are using) can store images.
Second, you should use a wrapper for images (there might be some). Don't use Object. I'm walking the path...
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
I think that this question is probably more about JDBC than it is about EJB (though I guess CMP could serve you purposes).
I am moving this thread to the JDBC forum for further discussion...
I agree. Here's the link:
subject: how to insert image into mySql database
Similar Threads
Example for working this out.
is this sample code with good practice?
Hiding member !
Custom Tag Library