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.
heres what the java API says regarding this method :
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.
pos - the position in the BLOB value at which to start writing; the first position is 1
a java.io.OutputStream object to which data can be written
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
1.4 See Also:
so this method is supported , according to the API anyway.
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)
Joined: May 25, 2008
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