Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [FRIDAY] DBCP configuration

Craig R. McClanahan

2007-01-05

Replies:

On 1/5/07, Christopher Schultz <chris@(protected):
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Wesley,
>
> Wesley Wannemacher wrote:
> > When configuring the database connections, where do you tend to put
> > them?
>
> Without question: have your container create the connection pool and
> make it available via JNDI. This is the most portable configuration you
> can have.
>
> It allows the proper separation between development (the job of the
> programmers) and deployment (the job of the folks running the app
> servers). The folks who do the deployment should be in charge of running
> the app and database servers, so they know where they live, how much
> load they can handle, what special configuration options are best, etc.


There's one additional advantage to using JNDI for this ... in many shops
you have two or even three environments to worry about (development,
staging, production), each with its own database instance. Having the
database configuration for each instance in its own server means you do not
need to go tweak your connection parameters as you move your app from one
place to another.

- -chris


Craig
©2008 junlu.com - Jax Systems, LLC, U.S.A.