we are using jrun 4.0 application server for creating a datasource.
I get a connection from the datasource and pass it to ArrayDescriptor.
ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor("obj_xyz", connection);
ARRAY array = new ARRAY(arrayDescriptor, connection, (Object[])param);
obj_xyz is the object name on the oracle side.
(Object[])param is the array of data which i want to pass it to in parameter of stored procedure
somehow oracle.sql.ArrayDescriptor doesnt like the connection given by JRun Datasource and throws a ClassCastException.
but if i create a connection in my code and pass it to ArrayDescriptor it accepts it and runs fine.
I will appreciate any help regarding this.
Thanks
-
oracle.sql.ArrayDescriptor (2 messages)
- Posted by: santosh kaushik
- Posted on: August 24 2005 21:08 EDT
Threaded Messages (2)
- Datasources seem to wrap connections by Travis Stevens on August 31 2005 18:57 EDT
- To make things really easy by Travis Stevens on August 31 2005 19:14 EDT
-
Datasources seem to wrap connections[ Go to top ]
- Posted by: Travis Stevens
- Posted on: August 31 2005 18:57 EDT
- in response to santosh kaushik
Most pooling datasources wrap a connection. This is important to override the close() method so that the connection is not closed, only returned to the pool.
I use Commons DBCP pool and I found out that the wrapped pool is a "PoolableConnection" and I was able to call the method "getDelegate" which returned the actual connection. This really seems like a hack, but Oracle begets Hacks. -
To make things really easy[ Go to top ]
- Posted by: Travis Stevens
- Posted on: August 31 2005 19:14 EDT
- in response to Travis Stevens
use the datasource provided by oracle:
Use oracle.jdbc.pool.OracleDataSource