Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Image insertion  RSS feed

 
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!