jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes jdbc oracle and blob Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc oracle and blob" Watch "jdbc oracle and blob" New topic
Author

jdbc oracle and blob

pascal monfils
Greenhorn

Joined: Aug 09, 2004
Posts: 9
Hello everybody,

I'm facing a problem with JDBC and Oracle when trying to insert a file into a blob in the database.

Here's how i tried.

I create a row in the database using the empty_blob() function to initialize the blob column.
I then execute a select for update on that record ... this way Ilock the record and can in the same time have access to a blob object from the resultset.

I have in memory a byte[] array containing my docuement.
I use the setBytes() function on the blob to pass the bytes[] to the blob object.

At that moment, a SQLException is thrown : UNSUPPORTED FEATURE
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Check out the example I posted in this thread.

Hope that helps.

Jules
pascal monfils
Greenhorn

Joined: Aug 09, 2004
Posts: 9
thanks a lot !

greatly helpfull ... it works now ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jdbc oracle and blob
 
Similar Threads
inserting blob with CMP
how to insert CLOB data type
Oracle function using Java to return Blob is zero size
Transform Blob Object to Xml data
How to store & retrieve a video file from database?