You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by phani <ph...@vqindia.com> on 2003/10/03 08:01:43 UTC

How to create a connection pool

Hi,

I am using a bean to get connection for a db from my jsp page. But the problem is for each and every request the page fetches a connection from  the bean. This becomes a over head to the system.
What i want to do is i want to open n no (say 50 ) of connection when the server is started and any request must be routed through these connection only.

How to do this?

Thanks in advance.

phani

Re: How to create a connection pool

Posted by Kwok Peng Tuck <pe...@makmal.com>.
Maybe you can use the connection pooling provided by tomcat. See the 
JNDI how-to in the docs.

phani wrote:

>Hi,
>
>I am using a bean to get connection for a db from my jsp page. But the problem is for each and every request the page fetches a connection from  the bean. This becomes a over head to the system.
>What i want to do is i want to open n no (say 50 ) of connection when the server is started and any request must be routed through these connection only.
>
>How to do this?
>
>Thanks in advance.
>
>phani
>
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to create a connection pool

Posted by Prashanth Pushpagiri <pr...@yahoo.com>.
you should make your bean persistent (change the scope
to application) and then have it create 'n'
connections when first called. you can then reuse
connections. There are a number of implementations
available for connection pooling. You may want to
reuse them instead of re-creating the process.

Prashanth

--- phani <ph...@vqindia.com> wrote:
> Hi,
> 
> I am using a bean to get connection for a db from my
> jsp page. But the problem is for each and every
> request the page fetches a connection from  the
> bean. This becomes a over head to the system.
> What i want to do is i want to open n no (say 50 )
> of connection when the server is started and any
> request must be routed through these connection
> only.
> 
> How to do this?
> 
> Thanks in advance.
> 
> phani
> 


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to create a connection pool

Posted by "Philippe de M. Sevestre" <ph...@ciblis.net>.
Simple way: use the poolman jdbc driver.


----- Original Message -----
From: "java guru" <ja...@yahoo.co.in>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Quinta-feira, 3 de Outubro de 2002 09:28
Subject: Re: How to create a connection pool


> Hi -
>   I am not sure on what type of application you are
> building, but doing connection related stuff
> (including running sql over already established
> connection in jsp) isnt very good idea. Read about mvc
> model if you are in design stage.
>    In anycase, if you still need access to pooled
> connection, tomcat offers connection pooling (in the
> default server.xml ) and refer to apache jsp taglib on
> how to access one.
>
>
> FYI
> srini
>  --- phani <ph...@vqindia.com> wrote: > Hi,
> >
> > I am using a bean to get connection for a db from my
> > jsp page. But the problem is for each and every
> > request the page fetches a connection from  the
> > bean. This becomes a over head to the system.
> > What i want to do is i want to open n no (say 50 )
> > of connection when the server is started and any
> > request must be routed through these connection
> > only.
> >
> > How to do this?
> >
> > Thanks in advance.
> >
> > phani
> >
>
> =====
> Thanks and have great day
> srini
>
> ________________________________________________________________________
> Missed your favourite TV serial last night? Try the new, Yahoo! TV.
>        visit http://in.tv.yahoo.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to create a connection pool

Posted by java guru <ja...@yahoo.co.in>.
Hi -
  I am not sure on what type of application you are
building, but doing connection related stuff
(including running sql over already established
connection in jsp) isnt very good idea. Read about mvc
model if you are in design stage.
   In anycase, if you still need access to pooled
connection, tomcat offers connection pooling (in the
default server.xml ) and refer to apache jsp taglib on
how to access one.


FYI
srini
 --- phani <ph...@vqindia.com> wrote: > Hi,
> 
> I am using a bean to get connection for a db from my
> jsp page. But the problem is for each and every
> request the page fetches a connection from  the
> bean. This becomes a over head to the system.
> What i want to do is i want to open n no (say 50 )
> of connection when the server is started and any
> request must be routed through these connection
> only.
> 
> How to do this?
> 
> Thanks in advance.
> 
> phani
>  

=====
Thanks and have great day
srini

________________________________________________________________________
Missed your favourite TV serial last night? Try the new, Yahoo! TV.
       visit http://in.tv.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>