Error java.lang.ClassCastException: oracle_jdbc_driver_T4CPreparedStatement_proxy after Upgrade to iAs 10.1.3 (Doc ID 1092893.1)

Last updated on JUNE 17, 2010

In this Document
  Symptoms
  Changes
  Cause
  Solution
  References


Symptoms

While migrate an application running under Oracle Application Server 10.1.2 with Oracle JDBC Thin Driver 10.2.0.2 to Oracle Application Server 10.1.3 with Oracle JDBC Thin Driver 10.2.0.2, the following error is generated:
java.lang.ClassCastException: oracle_jdbc_driver_T4CPreparedStatement_proxy

The code that runs under the older system is effectively:
Connection conn = dataSource.getConnection();
OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement(sql);

The OraclePreparedStatement interface needs to be used because of the use of "INSERT ... RETURNING ..." to retrieve the value of the primary key, which is a GUID generated by the BEFORE INSERT trigger.

Query DML, which works with simple Statement or PreparedStatement instances returned by Connection.getStatement() or Connection.prepareStatement() calls have no problems accessing the database and returning values. The sanitized content of the first iteration of the data-sources.xml file is as follows:
<?xml version="1.0" standalone="yes">
<data-sources>
<managed-data-source name="myds" jndi-name="jdbc/mydsCoredDS" connection-pool-name="myConnectionPool" user="myuser" password="->jazn.com/myuser" tx-level="local" />
<connection-pool name="myConnectionPool" initial-limit="20" min-connections="20" max-connections="60" inactivity-timeout="1800" abandoned-connection-timeout="300" connection-retry-interval="5" max-connect-attempts="3"/
</data-sources>

Changes

Upgraded to Oracle Application Server 10.1.3.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms