This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can i store picture in my database

 
rajesh roy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

- http://www.servletsuite.com/servlets/upload.htm
- http://www.frontiernet.net/~imaging/FileUploadServlet.html
 
Manhar Puri
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajesh,

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.

http://www.onlamp.com/pub/a/onlamp/2002/05/09/webdb2.html

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

-Manhar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic