Re: About connection pooling



Mika Myllyvirta <mika.REMOVEmyllyvirtaTHE@xxxxxxxxxxxxxxxx> 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#Database%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.
--
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)
.



Relevant Pages

  • Re: When will IBM practice what they preach?
    ... Connection pooling is very important for good speeds with java apps. ... The good thing is that you chose Tomcat. ... I runs like hell - the iSeries is a wicked database server - and tomcat on ... then I know they are still trying to sell sell sell... ...
    (comp.sys.ibm.as400.misc)
  • DBCP Configuration with Tomcat 4.1.27 and mySQL
    ... I'm a Java Web developer NEWBIE that has inherited a website that ... another replica DEVELOPMENT website and upgraded it to Tomcat 4.1.27. ... I was told this version of Tomcat supports Database Connection Pooling ...
    (comp.lang.java)
  • Re: [JDBC] Connection pooling
    ... of course you should only use a tomcat when your app is a webapp. ... > Here are a few things I don't understand about connection pooling. ...
    (comp.lang.java.databases)
  • Re: About connection pooling
    ... how do I obtain the correct connection pooling for my ... > but DBCP and DBPool are packages providing connection pooling ... Actually DBCP is what is used by Tomcat, ... > Either jTDS pooling or Tomcat pooling. ...
    (comp.lang.java.databases)
  • Re: Jdbc connection pooling without app/J2ee server
    ... > BEA Weblogic appserver, we offer the best pooling there is... ... Tomcat does offer connection pooling. ... Alin. ...
    (microsoft.public.sqlserver.jdbcdriver)