aspose file tools*
The moose likes JDBC and the fly likes Inserting image at database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Inserting image at database" Watch "Inserting image at database" New topic
Author

Inserting image at database

Abed Rabie
Ranch Hand

Joined: Jun 24, 2003
Posts: 74
Dear All,

I'm new in trying to insert an image into a database. I asked and I found that I should insert the path of the image at the database. But this is a problem if the image's path is changed.

So please advice if there is any other way that I can go through to insert the image itself into the database.

Any links on net will be so good to begin.

Looking forward to hear from u soon.

thx for u all

Aabed


Abed Rabie
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Aabed,
You can store the image itself as a BLOB.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Abed Rabie
Ranch Hand

Joined: Jun 24, 2003
Posts: 74
Dear Friend,
Is this means that I should use certain kind of IO Streams to store this image or what I can do??

Sorry for asking alot but I'm new in this task.

Looking forward to hear from u soon.

Aabed
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Abed,
Sun's tutorial gives an example of a blob. Personally, I find it easiest to read/write the image as a binary stream.

And questions are more than welcome. That's why we are here
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Inserting image at database