oracle.sql.ArrayDescriptor

Discussions

EJB design: oracle.sql.ArrayDescriptor

  1. oracle.sql.ArrayDescriptor (2 messages)

    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
  2. 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.
  3. To make things really easy[ Go to top ]

    use the datasource provided by oracle:
    Use oracle.jdbc.pool.OracleDataSource