• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unsupported feature

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
nikil shar
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic