tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kwok Peng Tuck <pengt...@gmail.com>
Subject Re: connection pooling basic help please
Date Mon, 04 Apr 2005 12:24:24 GMT
Krishnakant Mane wrote:

>hello,
>I refered to the docs in tomcat 5 for connection
>pooling.  the document is pritty comprehencive and I
>understood the server.xml part of it.
>but now I want to know how exactly can I use a
>connection from the pool in my servlet.
>the example in tomcat documentation is on a jsp based
>applicatio.  but I don't understand how I use a pooled
>connection in a servlet.
>  
>
You use a pooled connection in a simillar manner to a driver managed 
connection, except that you look up a resource (JNDI in this case). In 
your servlet just look up the resource.

>should I initialise the connection in the Init method?
> how and when should I close the connection?
>  
>
You should close the connection immediately when you are done with it. 
Best not to pass references of them around. You would close them as a 
you would in a driver managed connection, that is Connection.close() ;

>and wat entries in the web.xml file will effect
>connection pooling?
>  
>
>Please help it is really urgent.
>thanks
>Krishnakant.
>
>Send instant messages to your online friends http://uk.messenger.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message