Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> class cast exception

class cast exception

From: <nitincharmy_at_gmail.com>
Date: Wed, 13 Jun 2007 03:22:57 -0700
Message-ID: <1181730177.578955.39120@a26g2000pre.googlegroups.com>


Hi All,

We have migrated an application from weblogic to Jboss server. In this application we are using the clob as given below:

public boolean insertMessageBody(
ControllerAlarmMessageBean oControllerAlarmMessageBean, Connection conn1, PreparedStatement ps1, ResultSet rs1) throws ADCMDCException {
String errorCode = new String("DEFAULT"); BufferedWriter wr = null;
try {
Clob clob = null;
executeDML(queryReader.getValue("hps.insert.InitializeJobLogMessageClob"), conn1,
oControllerAlarmMessageBean.getLMessageId()); ps1 =
conn1.prepareStatement(queryReader.getValue("hps.insert.JobLogMessageClob")); ps1.setLong(1, oControllerAlarmMessageBean.getLMessageId()); rs1 = ps1.executeQuery();
if (rs1 != null) {
rs1.next();
clob = rs1.getClob("message");
wr = new BufferedWriter(((weblogic.jdbc.common.OracleClob) clob) .getCharacterOutputStream());

This code was running good but when we migrated the code & tried to use oracle driver with it, it throws "class cast exception" with the code given below:

wr = new BufferedWriter(((oracle.sql.CLOB) clob).getCharacterOutputStream());

As you can see we have changed "weblogic.jdbc.common.OracleClob" to "oracle.sql.CLOB".
we are using ojdbc14.jar oracle driver.

Any help would be appreciated.

Thanks & regards
Nitin Srivastava Received on Wed Jun 13 2007 - 05:22:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US