aspose file tools*
The moose likes JDBC and the fly likes exception in retrieveing 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 "exception in retrieveing Blob" Watch "exception in retrieveing Blob" New topic
Author

exception in retrieveing Blob

Luqman Qaiser
Greenhorn

Joined: Aug 21, 2005
Posts: 18
Hi,
I am trying to retrieve a Blob from database in java.
Blob b =rs.getBlob("JOB");

But am getting this exception
java.lang.UnsupportedOperationException
at sun.jdbc.odbc.JdbcOdbcResultSet.getBlob(Unknown Source)

I am using the following driver
sun.jdbc.odbc.JdbcOdbcDriver

Kindly suggest the solution.

regards,
Lucky
Luqman Qaiser
Greenhorn

Joined: Aug 21, 2005
Posts: 18
i am using jdk1.4 and Oracle9i
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The reason for the exception is exactly what the exception message says: the getBlob() method is unsupported. So you can't use it with the driver you are currently using.

If you are using Oracle, why not use one of the JDBC drivers which comes with that?
[ August 22, 2005: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Luqman Qaiser
Greenhorn

Joined: Aug 21, 2005
Posts: 18
Hi Paul,
I even tried oracle.jdbc.driver.OracleDriver,I have downloaded the latest jars like classes12.jar,ojdbc14.jar for this driver, still the exception persists.
Can you please be more specific as to which driver implements or supports the method getBlob().

Thanks and regards,
Lucky.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Hmm. I'm currently using the getBlob() method with the thin driver supplied with v10i. Works fine.

If the exception remains:

sun.jdbc.odbc.JdbcOdbcResultSet.getBlob(Unknown Source)

then you are still using Sun's JDBC-ODBC Bridge driver.

[ August 22, 2005: Message edited by: Paul Sturrock ]
[ August 22, 2005: Message edited by: Paul Sturrock ]
Luqman Qaiser
Greenhorn

Joined: Aug 21, 2005
Posts: 18
Hi Paul,

I searched for v10i driver for oracle but no, 0 results
Is it a oracle driver? if yes please point me where i can download it and also the url to be specified in code.

Thanks and regards,
Lucky
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Get it where you got your other driver classes. Looking at the JavaDocs for the v8.1.7 thin driver though, the getBlob() method is not flagged as unsupported, so you shouldn't have to use a newer version of the driver. If you post the code you use to get your connection, perhaps we can see where you are going wrong.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exception in retrieveing Blob
 
Similar Threads
Hibernate BLOB retrieving
Conversion Blob to Byte Array
JDBC - BLOB question for Java gurus
Conversion Blob to Byte Array
How to convert FormFile into BLOB object?