Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2012-07-21T12:54:36Z by JPdev
RaghuV
RaghuV
1 Post
ACCEPTED ANSWER

Pinned topic Oracle CLOB - Java JDBC Development

‏2012-06-22T07:56:24Z |
Need Support for working Oracle CLOB Via JNDI Oracle Connection Using OracleDatasource.

I am unable Insert data on Oracle CLOB Data Type in Oracle 10G.I have used thin Driver -ojdbc14.jar. My Java Runtime Environment is Java1.5.

As per Oracle Documenation to use CLOB ,
for insering data via preparedstatment , it is required to get oracle.jdbc.CLOB as below.
This required OracleConnection instead of interface java.sql.Connection.

// If the temporary CLOB has not yet been created, create new
tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);

So for this i get an error during lookup at following line.

myDataSource = (OracleDataSource) initCtx.lookup(strDSN);

Exception:
com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource incompatible with oracle.jdbc.pool.OracleDataSource
Updated on 2012-07-21T12:54:36Z at 2012-07-21T12:54:36Z by JPdev
  • JPdev
    JPdev
    18 Posts
    ACCEPTED ANSWER

    Re: Oracle CLOB - Java JDBC Development

    ‏2012-07-21T12:54:36Z  in response to RaghuV
    Hello!
    This is not surprising, you are using a JNDI env from JAVA IBM.
    ORACLE support ONLY SUN/ORACLE JAVA runtime.
    So your cast 'OracleDataSource' is not supported by ORACLE and i think the binding of your Oracle Datasource to the IBM JNDI (if correct!) don't work.
    I suggest you use the JAVA runtime of your ORACLE database which is located in dir xx/oracle/product/xxxx/xxx//jdk/bin/java .
    Another sensitive question, how have you define the OracleDatasource and bind it to the JNDI env?
    ORACLE use javax.naming.* and javax.naming.spi.*

    regards.