- 3,722,541 Users
- 2,244,332 Discussions
- 7,849,915 Comments
Forum Stats
Discussions
Categories
- 16 Data
- 362.2K Big Data Appliance
- 7 Data Science
- 2K Databases
- 592 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 32 Multilingual Engine
- 495 MySQL Community Space
- 7 NoSQL Database
- 7.7K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 419 SQLcl
- 57 SQL Developer Data Modeler
- 185K SQL & PL/SQL
- 21.1K SQL Developer
- 2.3K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.5K Development Tools
- 12 DevOps
- 3K QA/Testing
- 323 Java
- 10 Java Learning Subscription
- 12 Database Connectivity
- 70 Java Community Process
- 2 Java 25
- 11 Java APIs
- 141.2K Java Development Tools
- 8 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 135 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 14 Java SE
- 13.8K Java Security
- 3 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 145 LiveLabs
- 34 Workshops
- 9 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 4 Deutsche Oracle Community
- 15 Español
- 1.9K Japanese
- 3 Portuguese
java.lang.ClassCastException: weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB??

612177
Member Posts: 21
Hello. I'm trying to bring back a BLOB object from a PL/SQL procedure. I keep getting a class cast exception when I do it
java.lang.ClassCastException: weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB cannot be cast to oracle.sql.BLOB
I get similar results with oracle.sql.BLOB or java.sql.Blob.
What I've noticed is that when I'm not using a JDBC URL with my AM to do the SQL it does not fail. It's when I change to a JDBC Datasource I get the class cast exception. Any ideas?
Thanks, Graeme.
java.lang.ClassCastException: weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB cannot be cast to oracle.sql.BLOB
I get similar results with oracle.sql.BLOB or java.sql.Blob.
What I've noticed is that when I'm not using a JDBC URL with my AM to do the SQL it does not fail. It's when I change to a JDBC Datasource I get the class cast exception. Any ideas?
Thanks, Graeme.
Answers
-
WLS properly wraps all vendor-specific types when using a connection pool. What you can do is to check the connection you are using to call the stored proc, and if it is a WL connection, call getVendorConnection() on it to get the oracle connection which is being wrapped.
John -
Thanks for the response. How do I get the WLConnection to get the getVendorConnection method available? I have the DBTransaction class from my AM, but I can't cast it to a WLConnection class to use that method. Any ideas how to do this?
Thanks. -
In the connection pool uncheck the property "Wrap Data Types".
By default, data type objects for Array, Blob, Clob, NClob, Ref, SQLXML, and Struct, plus ParameterMetaData and ResultSetMetaData objects are wrapped with a WebLogic wrapper. This allows for features like debugging and connection usage to be done by the server.
The wrapping can be turned off by setting this value to false. This improves performance, in some cases significantly, and allows for the application to use the native driver objects directly. -
Hi
I am using Weblogic 10.3.0. I am also getting the same exception. But I don,'t see the option of unchecking Wrap Data Types under Connection Pool , Adavanced settings.
Could you please tell me how do I disable this option in weblogic 10.3.0.
Regards
Praveena
This discussion has been closed.