in Java EE, WebLogic Server

Prevent Weblogic Server from wrapping data types

By default, Weblogic Server wraps data types such as Struct, Blob, Array, Clob, etc.

For instance, oracle.sql.STRUCT becomes weblogic.jdbc.wrapper.Struct_oracle_sql_STRUCT.

That can become a problem if for instance you’re expecting a data type :

oracle.sql.STRUCT objSTRUCT = (oracle.sql.STRUCT) callableStatement.getObject(2);

This would raise the following error :

java.lang.ClassCastException: weblogic.jdbc.wrapper.Struct_oracle_sql_STRUCT

To avoid it, one can simply disable that wrapping in the Weblogic administration console :

Go to Services > Data sources > Select your datasource > “Connection pools”¬†tab > Advanced¬† :

uncheck “Wrap data types”


Note : Weblogic Server version used is 10.3.5