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

Home -> Community -> Usenet -> c.d.o.misc -> Re: CLOB problem in JAVA

Re: CLOB problem in JAVA

From: Jim McMahon <jp_mcmahon_at_hotmail.com>
Date: Mon, 25 Jul 2005 22:46:03 GMT
Message-ID: <42e56ba9.343839557@nntp.charter.net>


"Lig" <lignite_at_iol.ie> wrote:

>Hi :
>
>I am getting a casting exception (java.lang.ClassCastException:
>com.ibm.ws.rsadapter.jdbc.WSJdbcConnection) when invoking the
>CLOB.createTemporary metehod. Extract of relevant lines shown below:
>Any
>ideas how I can resolve this?
>
>Versions:
>
>Oracle 9i
>WebSphere Ver 5.1
>
>Cheers
>Lig
>
>
>
>import java.io.Writer;
>import java.sql.Clob;
>import java.sql.Connection;
>import java.sql.CallableStatement;
>import java.sql.ResultSet;
>import java.sql.SQLException;
>import java.sql.Blob;
>import javax.sql.DataSource;
>import javax.naming.InitialContext;
>import javax.naming.Context;
>import javax.naming.NamingException;
>import java.util.List;
>import java.util.ArrayList;
>import java.sql.Types;
>import oracle.jdbc.OracleConnection;
>import oracle.jdbc.driver.*;
>import org.apache.commons.logging.Log;
>import org.apache.commons.logging.LogFactory;
>import oracle.sql.CLOB;
>
>.
>.
>.
>
>Context jndiContext = new InitialContext();
>DataSource ds = (DataSource)jndiContext.lookup("java:comp/env/"
>+s_dataSource);
>Connection conn = ds.getConnection();
>tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION );
>
>Error Encountered: -
> java.lang.ClassCastException:
>com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
>

Without seeing the declaration for your tempClob object and looking up the return type of the CLOB.createTemporary() method this is only a guess and a hint:

You might be confusing the object type java.sql.Clob with the object type oracle.sql.CLOB - be sure which one you are using and check the docs for which one you need.

Hope this helps.

Jim

Being ordinary and nothing special is a full-time job. jp_mcmahon_at_hotmail.com (Jim McMahon in real life) Received on Mon Jul 25 2005 - 17:46:03 CDT

Original text of this message

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