my dog learned polymorphism*
The moose likes JDBC and the fly likes how can i store picture in my 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 can i store picture in my database" Watch "how can i store picture in my database" New topic

how can i store picture in my database

rajesh roy

Joined: Mar 23, 2007
Posts: 4
hello friends , i want to store picture in my data base. im working on java&using mysql as database.can any one can provide me code to generate it.
Jenn Person
Ranch Hand

Joined: Jan 16, 2005
Posts: 89
Hi Rajesh,

I don't know how to do it myself, but I did a quick search and found this which may help get you started:

Manhar Puri
Ranch Hand

Joined: Aug 23, 2005
Posts: 41

You can convert the image data to a stream and then store this in a column of type BLOB. The website below provides the table design but the code is PHP.

Other more generic solution, could be to store "the location of the image on the hard drive", in the database.

I agree. Here's the link:
subject: how can i store picture in my database
Similar Threads
Byte array manipulation
display a picture stored in a DB with HTML
Storing Picture in Access DataBase
upload an image and save it on the server
Upload attachment using Java