Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 24499 invoked from network); 9 Feb 2007 06:37:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2007 06:37:38 -0000 Received: (qmail 66013 invoked by uid 500); 9 Feb 2007 06:37:39 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 65784 invoked by uid 500); 9 Feb 2007 06:37:36 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 65768 invoked by uid 99); 9 Feb 2007 06:37:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 22:37:36 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of flamefew@gmail.com designates 66.249.82.237 as permitted sender) Received: from [66.249.82.237] (HELO wx-out-0506.google.com) (66.249.82.237) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 22:37:27 -0800 Received: by wx-out-0506.google.com with SMTP id h31so762706wxd for ; Thu, 08 Feb 2007 22:37:06 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=s80N4XiVPsum4BWDfWJtSS3HpFFGFq44Tt8uksVXvKoD+IGNqt8ndNIqiXk1pR0KN36A2UMfjIAxxv7brg7phQ8rnvxO8xUcD1XcerLdP4jCGleUfWA8sSs2MHFxCLNGj6ErC/0wse9NccdMWOztPlxINmxGDlnjUNZsAnVbRQ4= Received: by 10.90.79.6 with SMTP id c6mr12030742agb.1171003026315; Thu, 08 Feb 2007 22:37:06 -0800 (PST) Received: by 10.90.51.20 with HTTP; Thu, 8 Feb 2007 22:36:43 -0800 (PST) Message-ID: <31cc37360702082236h61118c32i818b33ef845383@mail.gmail.com> Date: Thu, 8 Feb 2007 22:36:43 -0800 From: "Henri Yandell" To: "Jakarta Commons Users List" Subject: Re: JNDI + dbcp + commons-dbcp-1.2.1.jar In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <25aac9fc0702071015n22cc23fco21757f9b2dd88987@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org At a guess, the Oracle code is trying to cast the connection to OracleConnection or some such. It's not an OracleConnection as DBCP wraps that with its own Connection implementation. Try doing: adTemp = ArrayDescriptor.createDescriptor("ARR_VARCHAR", ((DelegatingConnection)con).getDelegate() ); with an import of: import org.apache.commons.dbcp.DelegatingConnection; Hen On 2/8/07, karthik wrote: > > Hi > > Currently ,When i wanted to port my application "xyz.war" from OC4j > (oracle) to TOMCAT5.5 > I found some problems regarding JNDI usage in tomcat with Commons DBCP > > I have made use of Resource tag as follows > > auth="Container" > type="javax.sql.DataSource" > driverClassName="oracle.jdbc.driver.OracleDriver" > url="jdbc:oracle:thin:@//192.168.150.112:11654/xyz" > username="voise_20" > password="voise_20" > maxActive="100" > maxIdle="10" > maxWait="-1"/> > > > I still get the cast exception as below for Array Discriptor being used > > java.lang.ClassCastException > at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:108) > at > com.xius.infinet.ums.UMSBusinessClass.makeNewRolesAdmin(UMSBusinessClass.jav > a:423) > > > The Code being used is as follows > > 1>> con = (DBConnectionManager.getInstance()).getConnection(); > 2>> htReturnData = new Hashtable(); > 3>> adTemp = ArrayDescriptor.createDescriptor("ARR_VARCHAR", con); > 4>> ar = new ARRAY(adTemp, con, saPrivileges); > 5>> OracleCallableStatement cstmt = null; > 6>> InfinetUtility.log("UMSBusinessClass.makeNewRolesAdmin " + "{CALL > UMS_ADMIN.ROLEPROFILE_INSERT(?,?,?,to_number(?),?)}"); > 7>> cstmt = (OracleCallableStatement) con.prepareCall("{CALL > UMS_ADMIN.ROLEPROFILE_INSERT(?,?,?,to_number(?),?)}"); > 6>> cstmt.setString(1, sRoleName); > 9>> cstmt.setString(2, sRoleDesc); > 10>> cstmt.setARRAY(3, ar); > 11> cstmt.setString(4, new String("" + iNwId)); > 12>> cstmt.registerOutParameter(5, java.sql.Types.INTEGER); > 14> cstmt.execute(); > > > The exact nature of problem lies in line number "7" where ever the casting > happens > > > plz Can somebody explain me why am i getting this error as a result of using > "commons-dbcp-1.2.1.jar" > > > > with regards > Karthik > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org