• Post Reply Bookmark Topic Watch Topic
  • New Topic

Image insertion

 
akilan kandaswamy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai all,
pls some1 tell me how to insert a image into a database and retreving it from the database, Code will be helpful.
thanx
 
hanumanth reddy
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Read the Image Using Input stream and store that Store in the data base and retrive back and make it a file

 
David Freels
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to use a PreparedStatement and set the image to a stream. The database will store the image in a BLOB.
Here is a chapter from the tutorial with code examples:
http://java.sun.com/j2se/1.3/docs/guide/jdbc/blob.html
Hope this helps.
David
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!