Mika Myllyvirta <mika.REMOVEmyllyvirtaTHE@CAPITALSjamix.fi> said:
>Could somebody explain the connection pooling for me a bit more? Or to
>be specific, how do I obtain the correct connection pooling for my servlet.
>I have been aware of connection pooling and the benefits of pooled
>connections. Every time I read about this subject I get a different
>answer(!). So here is what I have found out: (the question mark stands
>for your correction if I am wrong :)
>
>1. jTDS (and jdbc) has a builtin connection pooling (?)
jdbc doesn't define connection pooling; jTDS could still very well have
an implementation of connection pooling included.
>2. Apache Tomcat has a builtin connection pooling (?)
Yes. See f.ex. http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Data
base%20Connection%20Pool%20(DBCP)%20Configurations
>3. and there are other classes that I can use to make my servlet to pool
>connections (eg. DBPool, DBCP, JNDI (?))?
Not JNDI (it's again a specification, with multiple implementations),
but DBCP and DBPool are packages providing connection pooling
implementation. Actually DBCP is what is used by Tomcat, if I'm not
grossly mistaken.
>Which of these pools should I use?
Either jTDS pooling or Tomcat pooling. The former in case it provides some
functionality Tomcat (DBCP) pooling doesn't provide, and that functionality
is important to you. If this is the case, I recommend to write enough
code to be able to configure the jTDS pool through Tomcat (as the default
Tomcat pool is configured), and thus keep the changes outside your servlet
code. I've done this to be able to use Oracle pooling implementation in
Tomcat, and it wasn't too hard.
If you need to have something fast (or "just yesterday"), then go ahead
with Tomcat pooling - and migrate to jTDS pooling later on - remembering
that your application code will not see the difference.

Signature
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
Robert Klemme - 16 Dec 2005 13:38 GMT
> Mika Myllyvirta <mika.REMOVEmyllyvirtaTHE@CAPITALSjamix.fi> said:
>> Could somebody explain the connection pooling for me a bit more? Or
[quoted text clipped - 11 lines]
>
> jdbc doesn't define connection pooling;
http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/PooledConnection.html
> jTDS could still very well
> have
> an implementation of connection pooling included.
http://jtds.sourceforge.net/faq.html
>> 2. Apache Tomcat has a builtin connection pooling (?)
>
> Yes. See f.ex.
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Data
base%20Connection%20Pool%20(DBCP)%20Configurations
>> 3. and there are other classes that I can use to make my servlet to
>> pool connections (eg. DBPool, DBCP, JNDI (?))?
[quoted text clipped - 24 lines]
> remembering
> that your application code will not see the difference.
I don't see any jTDS connection pooling on the horizon so I'd stick with
the most general in this case, Tomcat pooling. It comes with the servlet
container and needs no additional packages.
Kind regards
robert