This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Oracle/OAS and the fly likes jpg to BLOB and BLOB to JPG Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "jpg to BLOB and BLOB to JPG" Watch "jpg to BLOB and BLOB to JPG" New topic
Author

jpg to BLOB and BLOB to JPG

ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146


I have to convert a .jpg file to BLOB and upload it to Oracle DB.


Read the same BLOB and convert that in to jpg and save that to disk.


could some one help me with some links and sample codes .

Am in urgent need of it


Discussion - the powerfull way to excellence!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37884
    
  22
That doesn't look like a "general" Java question. Moving.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

Ram,
Have you read the JDBC tutorial yet? It contains code for dealing with BLOBs.

Feel free to post a more specific question to get more specific help.


[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
Joseph Macer
Ranch Hand

Joined: Apr 20, 2008
Posts: 63
As Jeanne mentioned, the JDBC is a good way to deal with databases. I use JDBC to perform all sorts of operations on a MySQL database without much trouble. Since you're storing a file, you could simple open a stream to the file like normal and read it directly into a String, for example, and save the String into a BLOB.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jpg to BLOB and BLOB to JPG
 
Similar Threads
XML, flat files to database
Writing as a JPG file to disk
need to read the blob and convert it into a file
convert .doc to image .jpg
need to convert oracle blob into a file