cancel
Showing results for 
Search instead for 
Did you mean: 

problem with java.sql.Clob and oracle.sql.CLOB

Former Member
0 Kudos

Hi,

I am using oracle9i and SAP web application server. I am getClob method and storing that in java.sql.Clob and using the getClass().getName() I am getting the class name as oracle.sql.CLOB. But when I am trying to cast this to oracle.sql.CLOB i am getting ClassCastException. The code is given below

java.sql.Clob lOracleClob = lResultSet.getClob(lColIndex + 1);

lPrintWriter = new PrintWriter(new BufferedWriter (((oracle.sql.CLOB) lOracleClob).getCharacterOutputStream()));

lResourceStatus = true;

can anybody please tell me the what is the problem with this and solution.

thanks,

Ashok.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ashok

You can get a "ClassCastException" when the JVM doesn't have access to the specific class (in your case, "oracle.sql.CLOB").

Just check your classpath and see if you are referring to the correct jar files.

cheers

Sameer

PS: Please award points if you find the answer useful