Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> ClassCastException with StructDescriptor.createDescriptor() & DataSource
Hello,
I'm using Oracle 9i in a J2EE environnement (Jboss3.0.4 for testing and websphere5 for production) with a thin driver v9
I would like to create a StructDescriptor object for a given Oracle object type like this:
StructDescriptor structdesc = StructDescriptor.createDescriptor
(sql_type_name, connection);
All works fine when testing it outside the application server, with a simple JDBC connection.
But when I use it with a Jboss DataSource, I obtain a
"ClassCastException" with my connection (I suppose I will obtain the
same result with a WAS5 DataSource).
Method "public static StructDescriptor createDescriptor (String s,
java.sql.Connection connection)" in class "oracle.sql.StructDescriptor"
seems to Class Cast the "java.sql.Connection" object in a
"oracle.jdbc.OracleConnection" one.
So this method seems to depends on the connection's implementation
class, which I can't control when obtaining it from a DataSource.
How to make it works with a generic DataSource?
Thanks
-- Posted via http://dbforums.comReceived on Fri Jun 13 2003 - 10:08:13 CDT
![]() |
![]() |