tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: jdbc driver fails with tomcat
Date Fri, 26 Sep 2008 16:57:34 GMT
Hash: SHA1


Dini Omar wrote:
> I am trying to send an array to a pl/sql module but for some reason i am
> unable to get the connection object.
> Here is the line of code that fails
> [code]
> Connection conn = null;
> ArrayDescriptor rectabDescriptor =
> ArrayDescriptor.createDescriptor("CCS21_CONSIGNMENTLIST_TYPE",conn);

It's odd that your exception says DelegatingCallableStatement (which is
the actual type of the object being casted) when the line indicated
neither performs a cast, nor does anything with a statement.

Are you sure this is the right line number?

> ARRAY awbNoHwbs = new ARRAY(rectabDescriptor,conn,childLessAwbs);
> ARRAY hwbs = new ARRAY(rectabDescriptor,conn,hwbList);
> OracleCallableStatement cst =
> (OracleCallableStatement)conn.prepareCall(stp.SUBMIT_CONSIGNMENT_STORED_PROC);

I'm guessing that the above line is the one where the problem is really
occurring. conn.prepareCall returns a DelegatingCallableStatement
instead of the Oracle-specific one you are expecting.

Do you /need/ to use OracleCallableStatement, here? If not, you should
simply use java.sql.CallableStatement and you should be good to go.

If you need to access the underlying OracleCallableStatement, then
you'll need to go through some hoops to get that actual object. Perhaps
something like this:

DelegatingCallableStatement dcs =

OracleCallableStatement =

This is a big dangerous, though, because Tomcat doesn't make too many
guarantees about the structure of the objects in the dbcp.dbcp package.
Also, the "innermost delegate" might not actually be your Oracle statement.

My advise would be to try to stick to using only objects and interfaces
in the JDBC API unless you absolutely need to (for instance, to create
Oracle-specific arrays from templates or whatever this stuff is).

The Oracle driver ought to allow you to interact a bit more naturally
with the JDBC API and not require you to use OracleCallableStatement
objects and stuff like that.

Hope that helps,
- -chris

Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message