Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / December 2005

Tip: Looking for answers? Try searching our database.

About connection pooling

Thread view: 
Mika Myllyvirta - 14 Dec 2005 08:12 GMT
Hi,

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 am using jTDS (1.1) driver to connect MS SQL Server and Apache Tomcat
(5.5) to keep my servlet serving and I use Jakarta redirector for IIS to
redirect servlet requests to Tomcat. The actual app is an Applet.

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 (?)
2. Apache Tomcat has a builtin connection pooling (?)
3. and there are other classes that I can use to make my servlet to pool
connections (eg. DBPool, DBCP, JNDI (?))?

Which of these pools should I use?

Cheers,
Mika
Juha Laiho - 14 Dec 2005 21:35 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.