File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Unsupported feature Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Unsupported feature" Watch "Unsupported feature" New topic
Author

Unsupported feature

nikil shar
Ranch Hand

Joined: May 25, 2008
Posts: 116
hi all,
am trying to write BLOB to an oracle db and i get this error :

Unsupported feature

JDBC driver i am using is :

Driver name: Oracle JDBC driver
Driver version: 9.2.0.1.0
Driver major version: 9
Driver minor version: 2


line at which it throws the error



CLASSPATH=C:\oracle\ora92\jdbc\lib\ojdbc5.jar;


please let me know if i am missing something.

thanks.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

No, I don't think you are missing anything. That version of the database driver doesn't support the setBinaryStream method, as the message says.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

JDBC drivers are black boxes and there's no never a guarantee they will implement 100% of the items in the JDBC API interface. The further away you get from commonly used features, such as blobs and key generation, the less likely these features are to be available. You should consult the documentation for your driver, as I'm sure there's probably some way to accomplish the same task with a different method. On the bright side, at least the error message it gave you was extremely descriptive.


My Blog: Down Home Country Coding with Scott Selikoff
nikil shar
Ranch Hand

Joined: May 25, 2008
Posts: 116
heres what the java API says regarding this method :

java.​sql.​Blob
public OutputStream setBinaryStream(long pos) throws SQLException
Retrieves a stream that can be used to write to the BLOB value that this Blob object represents. The stream begins at position pos. The bytes written to the stream will overwrite the existing bytes in the Blob object starting at the position pos. If the end of the Blob value is reached while writing to the stream, then the length of the Blob value will be increased to accomodate the extra bytes.
Note: If the value specified for pos is greater then the length+1 of the BLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
Parameters:
pos - the position in the BLOB value at which to start writing; the first position is 1
Returns:
a java.io.OutputStream object to which data can be written
Throws:
SQLException - if there is an error accessing the BLOB value or if pos is less than 1 SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

See Also:
Blob.getBinaryStream


so this method is supported , according to the API anyway.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

nikil shar wrote:
Throws:
SQLException - if there is an error accessing the BLOB value or if pos is less than 1 SQLFeatureNotSupportedException - if the JDBC driver does not support this method

Did you read this?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

nikil shar wrote:heres what the java API says regarding this method


An API is not the same thing as an implementation. For JDBC drivers in particular, there's in no guarantee a JDBC driver will support any of the methods in the API. You have to check the documentation as I said earlier for the driver (not the documentation for the API)
nikil shar
Ranch Hand

Joined: May 25, 2008
Posts: 116
Ah i see now !! can you advise where i can get hold of the doco for the JDBC driver ?? i am using ojdbc5.jar.

thanks for clarifying this for me. i used to think if the API says its supported then the driver has to implement it
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unsupported feature