This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

insert and retrieve image from database.

 
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
 
author
Posts: 4107
28
Google Web Toolkit Eclipse IDE Flex
  • 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
 
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.
 
Your buns are mine! But you can have this tiny ad:
Java Code Review and Psychology
https://coderanch.com/t/714798/java/Java-Code-Review-Psychology
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!