Thread: JDBC 2.0 and pooled connections?

JDBC 2.0 and pooled connections?

From
"Dr. Evil"
Date:
With PG, there is a fork every time a connection is started.  This is
expensive, and my web application will need to have a connection from
every page it serves.  The right way to do this is to have the servlet
maintain a connection pool.

What's the right way to do this with PG's JDBC driver?  I notice that
there is a class for JDBC 2.0 in PG 7.1.x, and JDBC supports a
DataSource interface which could do pooling.  Does anyone know if it
actually does pooling, and if so, do you have any example code of how
this would work in a servlet?  This will be a tremendous performance
boost.  It will cut page load time by 75% I would imagine.

Thanks for any tips.  Btw, this is all with JDK 1.3.1, PG 7.1.2, and
Tomcat 4.0, so it's all modern stuff.