tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Héctor Pérez <hepe...@hotmail.com>
Subject RE: Pool connection to database
Date Wed, 03 Oct 2001 05:04:24 GMT
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 (??) <jacob@cht.com.tw>
To: <tomcat-user@jakarta.apache.org>
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" <pablo@sortes.com>
> To: <tomcat-user@jakarta.apache.org>
> 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
> > ==================================
> >
>
>

Mime
View raw message