wood burning stoves 2.0*
The moose likes JDBC and the fly likes updating lobs in oracle database! 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 » Databases » JDBC
Bookmark "updating lobs in oracle database!" Watch "updating lobs in oracle database!" New topic

updating lobs in oracle database!

honey singh
Ranch Hand

Joined: Apr 26, 2002
Posts: 44
I'm making an application which updates files of any format into the database field using the Blob variable...now I'm able to write it in the database using the input and output streams....it is getting loaded into the database, but when I retrieve it then it creates the file there but with the length of the file zero.....
This was the first problem and now the second thing is that I want to know how to open the file of different format....I mean if it is text file then open it by text editor, if it is image file then open it with image editor....
I'm making the application using java....so please anybody can tell me how to know which file opens with which thing and how to read from the database field so that it doesn't give file of zero length...
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 565
Presumably you are trying to write the file to a hard drive? Is this on NT or Unix? If on Unix, does the app have permission / rights?
The answer to your second question is way over my head, but either the whole question is OS dependent or you need to find a class that will get the necessary info from whichever OS. Somebody else should jump in on this one! Actually it's not strictly JDBC this bit - you might have more luck in the Java in General forums.

I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
I agree. Here's the link: http://aspose.com/file-tools
subject: updating lobs in oracle database!
Similar Threads
How to open text file in Executable Jar.
NULL in db-file.
Data File Format and reading header information
URLyBird search for the database records issue - advice needed
Deciphering the instructions