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

后端 未结 4 713
清歌不尽
清歌不尽 2021-01-13 15:50

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

相关标签:
4条回答
  • 2021-01-13 16:23

    I got this error while generating a jasper report.

    I replaced the class=oracle.jdbc.OracleBlob with class=java.sql.Blob in the jrxml file of that report. It worked for me.

    0 讨论(0)
  • 2021-01-13 16:26

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

    0 讨论(0)
  • 2021-01-13 16:29

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

    0 讨论(0)
  • 2021-01-13 16:48

    Dont Cast again like:

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

    Solution :

    OutputStream outstrm =(rs.getBlob(1)).setBinaryStream(1L); 
    
    0 讨论(0)
提交回复
热议问题