File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Image insertion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Image insertion" Watch "Image insertion" New topic

Image insertion

akilan kandaswamy

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.
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="" target="_blank" rel="nofollow"></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:
Hope this helps.
I agree. Here's the link:
subject: Image insertion
It's not a secret anymore!