Error java.lang.ClassCastException: oracle_jdbc_driver_T4CPreparedStatement_proxy after Upgrade to iAs 10.1.3
(Doc ID 1092893.1)
Last updated on JULY 27, 2019
Applies to:Oracle Containers for J2EE - Version 10.1.3.0.0 and later
Information in this document applies to any platform.
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:
The code that runs under the older system is effectively:
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:
<managed-data-source name="<DATA SOURCE NAME>" jndi-name="<JNDI NAME>" connection-pool-name="myConnectionPool" user="<USER NAME>" password="-><PASSWORD>" 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"/
Upgraded to Oracle Application Server 10.1.3.
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document