Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 22766 invoked from network); 26 Sep 2008 21:22:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Sep 2008 21:22:16 -0000 Received: (qmail 67168 invoked by uid 500); 26 Sep 2008 21:22:02 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 67143 invoked by uid 500); 26 Sep 2008 21:22:02 -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 67132 invoked by uid 99); 26 Sep 2008 21:22:02 -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 14:22:02 -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.30.56] (HELO QMTA06.emeryville.ca.mail.comcast.net) (76.96.30.56) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Sep 2008 21:20:59 +0000 Received: from OMTA14.emeryville.ca.mail.comcast.net ([76.96.30.60]) by QMTA06.emeryville.ca.mail.comcast.net with comcast id KT4A1a0031HpZEsA6ZMTS8; Fri, 26 Sep 2008 21:21:27 +0000 Received: from [192.168.1.105] ([68.55.225.178]) by OMTA14.emeryville.ca.mail.comcast.net with comcast id KZMS1a0043ra03G8aZMSc8; Fri, 26 Sep 2008 21:21:27 +0000 X-Authority-Analysis: v=1.0 c=1 a=xe8BsctaAAAA:8 a=tFBre-TWmij_P25UXeQA:9 a=Hu87osWpZfEgwZ7q_ZX_kao44s8A:4 a=rPt6xJ-oxjAA:10 Message-ID: <48DD5252.80205@christopherschultz.net> Date: Fri, 26 Sep 2008 17:21:22 -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: <48DD147E.4040302@christopherschultz.net> 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 Ziggy, Ziggy O wrote: > When i debug the code, it doesnt get to the point where i am initialising > the OracleCallableStatement object. It failed just after the initialisation > of the ArrayDescriptor object. Strange. Are you sure you are working with matching binary and source versions? > I have tried to change it to use CallableStatement and im now getting > another error. Here is how i've changed it to. > > CallableStatement cst = > conn.prepareCall(stp.SUBMIT_CONSIGNMENT_STORED_PROC); > > ArrayDescriptor rectabDescriptor = > ArrayDescriptor.createDescriptor("CCS21_CONSIGNMENTLIST_TYPE",conn); [snip] > java.lang.ClassCastException: > org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper > at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:149) > at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:115) > at com.abbt.ccs21.data.accessors.ConsignmentDAO.submitDeclaration(ConsignmentDAO.java:301) Now, this stack trace makes more sense to me. It looks like Oracle's driver expects the Connection object passed into the createDescriptor method to be an Oracle-specific connection. Try doing this instead: ArrayDescriptor rectabDescriptor = ArrayDescriptor.createDescriptor("CCS21_CONSIGNMENTLIST_TYPE", (((DelegatingConnection)conn).getInnermostDelegate()); Hopefully, that will get the Oracle-specific Connection object passed-into that method and then the driver will work properly. On a side note, could you use the java.sql.Array interface instead of the Oracle-specific ones? I've never done this, and it isn't entirely clear how to so it, but this might work: Array myArray = conn.createArrayOf("dataType", elements); Then you should be able to use the PreparedStatement.setArray method to assign it to a parameter. Connection.createArrayOf is part of JDBC 4.0 (Java 6), which you might not be using at this point. Just a thought. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjdUlIACgkQ9CaO5/Lv0PBZegCeIuHcpXn6x/eP3ZvFooy4twf0 XOEAoMCf0ZxTBTtxcB86hq8ax1qYM0Fm =6yjk -----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