tags:

views:

271

answers:

3

Hi all,

I am using BLOBs in my SPRING-Hibernate application its, giving "java.lang.ClassNotFoundException: oracle.sql.BLOB" in case of ORACLE as a database!

Exactly I am getting following:

Caused by: 
org.springframework.dao.InvalidDataAccessApiUsageException: Couldn't initialize OracleLobHandler because Oracle driver classes are not available. Note that OracleLobHandler requires Oracle JDBC driver 9i or higher!
nested exception is java.lang.ClassNotFoundException: oracle.sql.BLOB
+2  A: 

You need ojdbc.jar (or similar) on your classpath (this is the Oracle JDBC driver)

Here is a list of drivers, pick the one that suits your environment.

Bozho
A: 

Maybe your OSGI manifest does not export the right packages?

Hans Westerbeek
A: 

I'm having the same problem :-\

Using:

ECLIPSE DN 2.2.0-m1 Oracle 10g Express Edition ojdbc6.jar (tried ojdbc14.jar)

Anyone resolved this issue?

marcolopes
Yes, I was able to fix this issue. Actually this was 6 months back when I posted this question, so I can tell you what I can recollect at this moment. Actually LOB/BOB are handled differently in case of the ORACLE, so ORACLE expects us to use there API[oracle.sql.Lob] while working with LOB/BOB instead of stranded specified by the JDBC. For exact resolution I need to go back to the code, do you want me to tell you the exact fix?
Abhishek
Here is the exact answer: Use OracleLobHandler, the Oracle-specific implementation of Spring's LobHandler interface, requires a NativeJdbcExtractor for obtaining the native OracleConnection based on which oracle.sql.BLOB/CLOB classes are located/loaded!
Abhishek