Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 28115 invoked from network); 26 Sep 2008 16:58:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Sep 2008 16:58:22 -0000 Received: (qmail 65345 invoked by uid 500); 26 Sep 2008 16:58:06 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 65318 invoked by uid 500); 26 Sep 2008 16:58:06 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 65307 invoked by uid 99); 26 Sep 2008 16:58:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Sep 2008 09:58:06 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [76.96.62.40] (HELO QMTA04.westchester.pa.mail.comcast.net) (76.96.62.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Sep 2008 16:57:04 +0000 Received: from OMTA08.westchester.pa.mail.comcast.net ([76.96.62.12]) by QMTA04.westchester.pa.mail.comcast.net with comcast id KRqn1a00B0Fqzac54UxdjM; Fri, 26 Sep 2008 16:57:37 +0000 Received: from [192.168.1.105] ([68.55.225.178]) by OMTA08.westchester.pa.mail.comcast.net with comcast id KUxc1a00S3ra03G3UUxcqU; Fri, 26 Sep 2008 16:57:37 +0000 X-Authority-Analysis: v=1.0 c=1 a=xe8BsctaAAAA:8 a=YHd9gxv0iQeHJGe_epUA:9 a=m56f0rmsXLQJmtv4yBYA:7 a=SA1tHze3XrE-IqJGA8cJklmpzHsA:4 a=rPt6xJ-oxjAA:10 Message-ID: <48DD147E.4040302@christopherschultz.net> Date: Fri, 26 Sep 2008 12:57:34 -0400 From: Christopher Schultz User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: jdbc driver fails with tomcat References: In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dini, 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 = conn.prepareCall(stp.SUBMIT_CONSIGNMENT_STORED_PROC); OracleCallableStatement = (OracleCallableStatement)dcs.getInnermostDelegate(); 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjdFH4ACgkQ9CaO5/Lv0PARMgCgphBlDrwQWBWW73/a2cAG82Ju RaUAmwSmGtca3RVQc91kORrMuXiy2DXs =kZ3E -----END PGP SIGNATURE----- --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org