My Oracle Support Banner

Oracle Database Connection In Java Application Fails With weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection cannot be cast to oracle.jdbc.OracleConnection (Doc ID 2461077.1)

Last updated on MAY 31, 2023

Applies to:

JDBC - Version 11.1.0.6 and later
Information in this document applies to any platform.

Symptoms

In order to convert a JAVA array into an array used in an Oracle Stored Procedure, an Oracle Connection is needed for the “conn” in ArrayDescriptor.createDescriptor("<ARRAY TYPE>", conn) in a WebLogic 10.3.6 application.

Method 1.
When the connection is declared as java.sql.Connection and created from datasource defined in Weblogic 11g with the following settings:
URL: jdbc:oracle:thin:@//<IP ADDRESS>:<PORT>:<SID>
Driver Class Name: oracle.jdbc.OracleDriver
Properties: user=<USER>
Password: <PASSWORD>
the following exception is raised :
weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection cannot be cast to oracle.jdbc.OracleConnection

As the preceding method of getting an Oracle Connection fails, the following is tried, but also fails with the following exception:

Method 2.
String dbUrl = "jdbc:oracle:thin:@//<IP ADDRESS>:<PORT>:<SID>";
String dbUser = "<USER>";
String pswd = "<PASSWORD>";
Class.forName("oracle.jdbc.OracleDriver");
try
{
conn = DriverManager.getConnection(dbUrl,dbUser,pswd);




java.lang.NoSuchMethodError: oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I)Loracle/sql/converter/CharacterConverters;


Changes

 

Cause

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
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.