• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to insert images in Oracle

 
Jagmohan Negi
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to insert images in Oracle through Java?plz let me know by an example in Java
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It better to store images on the file system, and only store the path describing their location in the database. However, if you absolutely must store images in the database, you need to use a BLOB or CLOB datatype in your table and used the setBlob() method of a PreparedStatement.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34218
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More specifically a BLOB since an image is binary data, not character data.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
More specifically a BLOB since an image is binary data, not character data.

Woops. Posting with my brain only half turned on. Listen to Jeanne, Jagmohan Negi. She's paying more attention than I am.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34218
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul

Jagmohan,
As an example, take a look at jGuru's tutorial.
 
Jagmohan Negi
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx to all of u,Now i have done it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic