Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 43061 invoked by uid 500); 3 Oct 2001 04:46:50 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 43050 invoked from network); 3 Oct 2001 04:46:50 -0000 X-Originating-IP: [200.40.5.158] From: =?utf-8?B?SMOpY3RvciBQw6lyZXo=?= To: References: <001501c14b8e$a0577550$030000c0@chucko> <001901c14bae$81441540$2d5b900a@jacobpc> Subject: RE: Pool connection to database Date: Wed, 3 Oct 2001 02:04:24 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: X-OriginalArrivalTime: 03 Oct 2001 04:46:29.0915 (UTC) FILETIME=[5E33DEB0:01C14BC6] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N You must enclose de Connection Pool within a class with one object: the Pool. The Pool must be a variable within this class and when you call a specific method, if this variable is null, you create the pool, in the others cases you ask for a connection from the pool. The method you use must be proctected by sincronized clause, because this variable may be accesed by multiple objects or threads. It's clear?. I use this methodology and it works fine. Now you may use your connection pool in what ever you like: jsp, servlets, etc. ----- Original Message ----- From: Jacob FanChiang (??) To: Sent: Tuesday, October 02, 2001 10:55 PM Subject: Re: Pool connection to database > Hi: > You can put it in tomcat use > " > System.getProperties().put(key,value); > System.getProperties().getProperty(key); > " > Here is my solution. > I create the connections in constructor "ConnectionPool()". > I new the ConnectionPool instance in where I need to use it. > " > ConnectionPool dbPool = new ConnectionPool(); > Connection c = dbPool.getConnection(); > " > > Jacob FanChiang > > >From Taiwan > > Assoiciate Researcher > Customer Care and Billing System Dept. > Telecommunication Laboratories > Chunghwa Telecom Co., Ltd. > Tel: +886 2 3707 1098 > Fax +886 2 2325 5844 > Email: jacob@cht.com.tw > ----- Original Message ----- > From: "Pablo Morillas" > To: > Sent: Wednesday, October 03, 2001 6:07 AM > Subject: Pool connection to database > > > > Hello all. > > > > I have a problem that I suppose is resolved by Tomcat. I'm using Tomcat > 3.2 > > and I can connect to an Oracle 8i database. The problem is that a process > is > > created by oracle in any connection to the database done from mines > > servlets. I want to use a pool of connection for limit the number of > > connection actives. > > Is there any way to specify a class that run when I start tomcat? If I > have > > any pool connection running inside tomcat I think that I will get the > pool, > > won't I? > > > > Thanks to all in advance. > > > > ================================== > > Pablo Morillas > > http://www.sortes.com > > pablo@sortes.com > > ================================== > > > >