I found a promising-looking post in the archives about using DBCP in a
Tomcat-based servlet environment:
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg67843.html
Unfortunately, the link to the source code (the "meat" of the post) is
broken. Does anyone have any sample source code or other references
suggesting how to go about adding DBCP into a webapp? I have installed
the DBCP JAR library into my webapp's WEB-INF/lib, and the MySQL driver
JAR is in $CATALINA_HOME/common/lib, so I'm raring to go.
(I've read the instructions in the DBCP API and I think I get the idea.
It's not using DBCP's classes that I'm unsure of /per se/, rather it's
how to go about setting up DBCP in the context of a servlet container.
My first idea was to write a simple servlet that sets up the connection
pool in its init() method. Then I thought that seems a little
inelegant, and perhaps a ContextListener would do (it would listen for
the startup of my webapp and then initialize the connection pool when
the webapp starts). But I'm not sure if this is the right solution either.)
How do YOU implement DBCP?
Thanks,
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- Re: DBCP usage w/servlets Erik Price
- Re: DBCP usage w/servlets Jakarta
- Re: DBCP usage w/servlets Hannes Schmidt