This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes insert and retrieve image from database. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "insert and retrieve image from database." Watch "insert and retrieve image from database." New topic
Author

insert and retrieve image from database.

John McDonald
Ranch Hand

Joined: Jul 01, 2003
Posts: 112
Hi there,
I had an application using jsp to retrieve and store image to oracle. Anyone has any ideea how to start? I know insert syntax insert for oracle but never with the image. I appreciate a lot. Thanks.

John Giang
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703
    
    5

Take a look at the PreparedStatement API for blobs and clobs (such as setBlob). If your database columns are set up for binary data, you just need to use one of these methods to set inputstreams (from a file for example) into your update/insert statements.

http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html


My Blog: Down Home Country Coding with Scott Selikoff
John McDonald
Ranch Hand

Joined: Jul 01, 2003
Posts: 112
Hi Scott,
I know how to do PrepareState or ordinary Oracle but not the image. I would like to know from Java and Oracle point of views that how to create table to store and retrieve.

John
payal agrawal
Ranch Hand

Joined: Oct 11, 2005
Posts: 44
Look at the URl below:

How to store/retrieve image to/from SQLServer
http://www.java-tips.org/content/view/203/29/

In order to insert into Oracle database change the conection string for Oracle. Column type for image is Blob.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: insert and retrieve image from database.
 
Similar Threads
inserting image
How to store and retrive image through jsp page to oracle?
how to display image in JSP from oracle
how to store an image into the DataBase using oracle database
regarding image insertion in database