on 01-11-2005 1:35 AM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.