Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have problem retrieving a blob object from oracle DB to java API with jdbc. The problem is when I execute a Collable statement with a function from the db which return me a blob field this exception is thrown on the line :

tempBlob = (oracle.sql.BLOB)cstmt.getObject(1);

with this error message :

java.lang.ClassCastException: oracle.sql.BLOB cannot be cast to oracle.sql.BLOB. 

The object which I get from the DB is a instance of oracle.sql.BLOB. The tempBlob variable is a object oracle.sql.BLOB. Where is the problem?

share|improve this question
4  
Could be a classloader issue. –  Marko Topolnik Jul 10 '12 at 10:26
    
Yes it was :) thanks –  Jordan Borisov Jul 10 '12 at 11:19

2 Answers 2

up vote 3 down vote accepted

Two oracle jar files may be in your classpath. Please remove one jar and deploy again.

share|improve this answer
    
Thanks man. It worked. –  Jordan Borisov Jul 10 '12 at 11:17

Sometime one JAR is in the application classpath and another is in the application server classpath (eg.: in Tomcat $CATALINA_HOME/lib)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.