Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC-ODBC Blob insert error using prepared statement

 
Graeme Mooney
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am having issues storing a blob. My code is as follows:



When I run this I get the following error:

Exception in thread "main" java.lang.UnsupportedOperationException
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setBlob(Unknown Source)

It looks like it is looking for the wrong Prepared Statement as the error shows JdbcOdbcPreparedStatement when I want java.sql.PreparedStatement

Any help would be much appreciated.

Thanks,
Graeme
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there have been quite a few threads on here recently about clobs, have you read them, as it isn't as easy as just typing set blob.
I am sure the theory is the same for both.
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch, hope you like it here and stay around
 
Graeme Mooney
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies guys.

I have opted to use the setBinaryStream instead of the setBlob



This worked a charm.

I tried the setBlob method with a regular JDBC connectino and not JDBC-ODBC connection bridge and it worked ok. Unfortunatly i have to use the JDBC-ODBC connection bridge for what i am working on. If I find out why one works and the other doesnt i will post here.

Thanks,
Graeme
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JDBC-ODBC bridge is quite old and not much supported. It seems that the setBlob method was not actually implemented in that driver.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic