Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

insert and retrieve image from database.

 
John McDonald
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Saloon Keeper
Posts: 4028
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
John McDonald
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic