• 1 reply
  • Latest Post - ‏2012-07-21T12:54:36Z by JPdev
1 Post

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: incompatible with oracle.jdbc.pool.OracleDataSource
Updated on 2012-07-21T12:54:36Z at 2012-07-21T12:54:36Z by JPdev
  • JPdev
    18 Posts

    Re: Oracle CLOB - Java JDBC Development

    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.*