aspose file tools*
The moose likes JDBC and the fly likes Image insertion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Image insertion" Watch "Image insertion" New topic
Author

Image insertion

akilan kandaswamy
Greenhorn

Joined: Feb 26, 2001
Posts: 4
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

Joined: Jun 12, 2000
Posts: 118

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


<a href="http://www.jobklub.com" target="_blank" rel="nofollow">http://www.jobklub.com</a><br /> 'Add Job To Life'
David Freels
Ranch Hand

Joined: Feb 01, 2001
Posts: 102
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
 
 
subject: Image insertion
 
Similar Threads
Struts
inserting image
wants to configure next and previous buttons for database entry !
thumbnail in jsp
how to store an image into the DataBase using oracle database