You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Philippe Mathieu <ph...@lifl.fr> on 2004/08/25 15:40:58 UTC
connection Pool and realms : how to avoid redundances
Hi,
I am using Tomcat 5.0.xx under Linux Debian with Postgresql 7.xx
For me a correct war is a war where you don't have to touch to any pages to
deploy the application. I think everybody is according to this.
In my application, i'm using the Tomcat connection Pool with a JDBC connector
and a Realm for authentification. All is perfectly working BUT ....
- the database/user/password must be defined in the context definition for the
Pool and also for the Realm (thus 2 times !!).
- The pool name is defined in server.xml but also in web.xml and again in my JSP
to obtain the connection (thus 3 times !!)
I am however using the same method than described in the Tomcat doc in the "JDBC
DataSources" section :-(
How can i make my application to define once and for all, the database url and
the name of the pool ? (we could hope to define all in the server.xml context
application and then using "what is in the context" in the war, whitout any
redundances ?)
How can i make my application to avoid any references to the pool name in the
.war (since all is already defined in the context definition in server.xml) ?
How can i simply tell the Realm to use the database defined by the Pool ?
Thanks a lot for help
--
PM
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection Pool and realms : how to avoid redundances
Posted by QM <qm...@brandxdev.net>.
On Wed, Aug 25, 2004 at 03:40:58PM +0200, Philippe Mathieu wrote:
: For me a correct war is a war where you don't have to touch to any pages to
: deploy the application. I think everybody is according to this.
So far, so good.
: - the database/user/password must be defined in the context definition for
: the
: Pool and also for the Realm (thus 2 times !!).
Idea: DataSourceRealm
(Never used it, but I've seen it in the docs)
: - The pool name is defined in server.xml but also in web.xml and again in
: my JSP
: to obtain the connection (thus 3 times !!)
Idea: stop using Model1 architecture, so your JSPs don't have to know
about JDBC pools.
: I am however using the same method than described in the Tomcat doc in the
: "JDBC
: DataSources" section :-(
Idea: context.xml
These, and most of your other questions could also be answered by a
closer reading of the Tomcat docs and/or changing your build process
such that Ant sets up variable params for you based on templates.
-QM
--
software -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org