Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 10921 invoked from network); 26 Nov 2003 20:28:13 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 26 Nov 2003 20:28:13 -0000 Received: (qmail 16470 invoked by uid 500); 26 Nov 2003 20:27:58 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 16458 invoked by uid 500); 26 Nov 2003 20:27:58 -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 16445 invoked from network); 26 Nov 2003 20:27:57 -0000 Received: from unknown (HELO mta202-rme.xtra.co.nz) (210.86.15.145) by daedalus.apache.org with SMTP; 26 Nov 2003 20:27:57 -0000 Received: from web3-rme.xtra.co.nz ([210.86.15.140]) by mta202-rme.xtra.co.nz with ESMTP id <20031126202743.YWBL7019.mta202-rme.xtra.co.nz@web3-rme.xtra.co.nz> for ; Thu, 27 Nov 2003 09:27:43 +1300 Received: from tsl010 ([210.86.60.149]) by web3-rme.xtra.co.nz with ESMTP id <20031126202801.TGWH12184.web3-rme.xtra.co.nz@tsl010> for ; Thu,: 28:01 +1300 To: Jakarta Commons Users List Subject: Re: When does dbcp close a connection? References: Message-ID: From: John Zoetebier Organization: Transparent Systems Content-Type: text/plain; format=flowed; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Thu, 27 Nov 2003 09:30:12 +1300 In-Reply-To: User-Agent: Opera7.21/Linux M2 build 480 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Wed, 26 Nov 2003 17:34:05 +0100, Zsolt Koppany wrote: > Hi, > > I have looked into the dbcp sources and getConnection just returns a > java.sql.Connection object. Does that mean that connection.close closes > the > connection to the database? If not, when will be the connection really > closed? Connection.close will return the connection to the pool. After setting up DBCP yout code can basically stay the same. To close the real connection to the database at application shutdown do: connectionPool.close(); This will closed the actual connections to the databse. I made a wrapper class for setting up DBCP and closing the connection pool. -- John Zoetebier Web site: http://www.transparent.co.nz --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org