Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 49854 invoked from network); 19 Jun 2004 00:03:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 19 Jun 2004 00:03:37 -0000 Received: (qmail 83594 invoked by uid 500); 19 Jun 2004 00:03:52 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 83550 invoked by uid 500); 19 Jun 2004 00:03:52 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: 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 83527 invoked by uid 99); 19 Jun 2004 00:03:51 -0000 Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Fri, 18 Jun 2004 17:03:51 -0700 Received: (qmail 49814 invoked by uid 1304); 19 Jun 2004 00:03:26 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 19 Jun 2004 00:03:26 -0000 Date: Fri, 18 Jun 2004 17:03:26 -0700 (PDT) From: Rodney Waldhoff To: Jakarta Commons Users List Subject: Re: [dbcp] cast connection from datasource to OracleConnection failed. connection.getDelegate() returns a oracle.jdbc.driver.T4CConnection In-Reply-To: <20040618193052.86746.qmail@web50408.mail.yahoo.com> Message-ID: <20040618165952.I48163@minotaur.apache.org> References: <20040618193052.86746.qmail@web50408.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Rating: localhost 1.6.2 0/1000/N X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Fri, 18 Jun 2004, Kwan Michael wrote: > I m using Tomcat 4.1.27, oracle 9i. > > I have database pooling setup using dbcp (1.0 i > believe comes with tomcat 4.1.27) > > so after i retrieve my datasource > and i did the following > > Connection conn = ds.getConnection(); > System.out.println(conn.getDelegate().getClass.getName()); > > I read everywhere that it is suppose to be > OracleConnection, but it returns > oracle.jdbc.driver.T4CConnection (not even in oracle > javadoc) > > Anybody knows why? getDelegate simply returns whatever your underlying connection is. This will be a function of the underlying DataSource or connect string you're using. > I want to use OracleConnection because they provide > statement caching which is not provided in dbcp 1.0. DBCP 1.0 does in fact support PreparedStatement pooling by the way, although the Tomcat configuration doesn't expose a way to turn it on. If you use DBCP 1.0 directly (configured via JOCL or directly through Java) you can enable prepared statement pooling. It's only the DataSource configuration that doesn't expose it. > > I also did consider an upgrade to dbcp 1.1, 1.2 but > the performance is not as good as the documents > indicated (i see some performance down turn using > basically the same settings). That's curious. I wonder if anyone knows why that is. > > MK > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org