You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul Selibas <ps...@gmail.com> on 2008/09/17 15:00:06 UTC

DBCP Question

Greetings,
Firstly i am using Tomcat 5.5 and Java 1.5. I am writing a simple web app
but now my problem is the "setup" for the dbcp.

I have set up the app with the resource tag in the context.xml file in the
META-INF folder and it all works fine. Now for my problem... I would like to
be able to change the username, password, driver class etc from the app
itself (in order for people to point to different databases dynamically). My
first idea was to do all these settings in a properties file but i cant find
a way to get those property values into the context.xml. I am also open to
setting up the resource from the code itself but cannot find a way to do
this. Does anyone have any suggestions or ideas. I have done allot of
Googling with not luck.


Many thanks,

Paul Selibas

Re: DBCP Question

Posted by Paul Selibas <ps...@gmail.com>.
On Wed, Sep 17, 2008 at 3:03 PM, David Smith <dn...@cornell.edu> wrote:

> I think you'll have to have your webapp manage it's own DBCP pool
> locally.  I doubt there's a good way to change pool parameters on tomcat
> provide database pools on the fly.  At minimum, any change to the
> <Resource ... /> element config would require your webapp be restarted.
>

Thank you for your response. I don't mind restarting the web app after a DB
change. But it appears that i will have to manage the pooling myself or use
ibatis or some equivalent.

Re: DBCP Question

Posted by David Smith <dn...@cornell.edu>.
I think you'll have to have your webapp manage it's own DBCP pool
locally.  I doubt there's a good way to change pool parameters on tomcat
provide database pools on the fly.  At minimum, any change to the
<Resource ... /> element config would require your webapp be restarted.

--David

Paul Selibas wrote:
> Greetings,
> Firstly i am using Tomcat 5.5 and Java 1.5. I am writing a simple web app
> but now my problem is the "setup" for the dbcp.
>
> I have set up the app with the resource tag in the context.xml file in the
> META-INF folder and it all works fine. Now for my problem... I would like to
> be able to change the username, password, driver class etc from the app
> itself (in order for people to point to different databases dynamically). My
> first idea was to do all these settings in a properties file but i cant find
> a way to get those property values into the context.xml. I am also open to
> setting up the resource from the code itself but cannot find a way to do
> this. Does anyone have any suggestions or ideas. I have done allot of
> Googling with not luck.
>
>
> Many thanks,
>
> Paul Selibas
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org