• 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

how to store jpg/gif picture in Database

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want Know whether it is possible to store gif's or picture in Database? if yes! how and which DataBase to store? How about Oracle?
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far I know Oracle has very good feature to store gif/jpg images in database.
Infact we need to declare datatype as longvar(I am sure about the exact data type name refere Oracle jdbc doc) which store the data in binary form up some GIGA BYTES.
Basically you will read the gif/jpg file data and put it into longvar.
when ever you want to retrieve the data same read as binary and save as file with specific extention (gif/jpg).
Oracle 7.3 has very good documentation on JDBC where you can also find above information in detail.
Jahanns
jahanns@computer.org
http://jahanns.virtualave.net/
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes u can insert jpg/gif in the oracle database

go through the oracle documentation for the example to insert and retrieve the gif/jpg
the datatype used to store is longraw or raw
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI, all
Does anyone know how to handle gif/jpg in Mysql database?
I mean how to save and retrive gif/jpg in the client(broser) through jsp or servlet
thanks in advnace
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the database supports blobs, you can save the gif/jpg that way.
 
sean zang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,Thomas Paul
Could you please show me a simple code?
many thanks
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Blob is Binary Large Object basically you are simply using I/O Streams,go through the database documentation.
 
Amit Zzz Kulkarni
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi mohan raj,
I am posting my response to your question here so others can benefit.
http://oradoc.photo.net/ora81/DOC/java.815/a64685/oraext4.htm#1003223
>>>i found ur posted message in javaranch. there u have mentioned to use blob to storage large objects in oracle. i have used BFILE to store an gif file in oracle database. but i need to use BLOB to store that image. but the difficulty is i don't know how to store the file there ...can u show some sites or examples to do so..
Amit
 
I have always wanted to have a neighbor just like you - Fred Rogers. 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