• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

insert and retrieve image from database.

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic