cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC CLOB error

Former Member
0 Kudos

Hi,

I face the following error, i use the oracle jdbc driver as db driver and i use the same ojdbc14.jar file as the project library, but when i try to cast the clob object return from resutlset it throw me class cast exception, i did print out the class name it shown oracle.sql.CLOB, but when i cast the object to oracle.sql.CLOB it still show me the error.

Do you have any idea what is wrong?

====================// java code

import java.sql.Clob;

import oracle.sql.CLOB;

Clob clob = null;

if ( resultSet.next() )

{

clob = resultSet.getClob( 1 );

logger.debug( "resultSet.getClass() is " + resultSet.getClass() );

logger.debug( "clob.getClass() is " + clob.getClass() );

logger.debug( "clob is " + clob );

logger.debug( "(clob instanceof oracle.sql.CLOB) is " + (clob instanceof oracle.sql.CLOB));

CLOB oraClob = (CLOB)clob; // this is where the class cast exception occur

====================// log file

[10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- selectUpdateStatement is com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper@d5b222

[10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- resultSet.getClass() is class oracle.jdbc.driver.OracleResultSetImpl

[10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- clob.getClass() is class oracle.sql.CLOB

[10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- clob is oracle.sql.CLOB@1a21321

[10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- (clob instanceof oracle.sql.CLOB) is false

[10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- error

java.lang.ClassCastException

Accepted Solutions (0)

Answers (1)

Answers (1)

detlev_beutner
Active Contributor
0 Kudos

See