You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mohan Radhakrishnan <Mo...@hclcomnet.co.in> on 2003/01/07 06:22:18 UTC
RE: linking a struts application to a jndi resource through a dat
asource
HI,
We have done this with DBCP. Our doubt is this. If DBCP has a factory,
then it should also be a able to use our JTurbo pool connection factory ?
Right ? Isn't it like the commons logging factory which recognizes log4j or
java.util.Logging
Thanks,
Mohan
-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Tuesday, January 07, 2003 10:03 AM
To: Struts Users Mailing List; nick@fieldstonesolutions.com
Subject: Re: linking a struts application to a jndi resource through a
datasource
On 6 Jan 2003, Nick Torenvliet wrote:
> Date: 06 Jan 2003 22:46:26 -0500
> From: Nick Torenvliet <ni...@fieldstonesolutions.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>,
> nick@fieldstonesolutions.com
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: linking a struts application to a jndi resource through a
> datasource
>
> Hi, So I've got two pieces, on one side a working mysql struts data
> source example, on the other side a working tomcat 4.1 servlet.xml
> configured jndi resource linked to a mysql data base. I want to access
> the jndi from inside of struts, can I configure a data source to link to
> the jndi resource, if so should I be including any special name or key
> parameters in the datasource, or give it a special type?
>
If you want to use JNDI-based data sources, you don't need *anything* in
struts-config.xml, and you would use the standard JNDI programming logic
to utilize it. See the following docs for more info:
http://jakarta.apache.org/tomcat-4.1-doc/jndi-resources-howto.html
http://jakarta.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html
Although the mechanism for configuring a JNDI data source in your
container is container-specific, the setup of your web.xml file (i.e. a
<resource-ref> element) and the code to access it (getting the
InitialContext and so on) is portable.
Use *either* the Struts <data-source> *or* JNDI. Not both.
Craig
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: linking a struts application to a jndi resource through a dat
asource
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Tue, 7 Jan 2003, Mohan Radhakrishnan wrote:
> Date: Tue, 7 Jan 2003 10:52:18 +0530
> From: Mohan Radhakrishnan <Mo...@hclcomnet.co.in>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: RE: linking a struts application to a jndi resource through a
> dat asource
>
> HI,
> We have done this with DBCP. Our doubt is this. If DBCP has a factory,
DBCP does *not* have such a factory. It does *not* support pooled
connection factory (except in the partially added code from jdbc2pool that
I've never tried).
> then it should also be a able to use our JTurbo pool connection factory ?
> Right ?
No. It only works with JDBC drivers and plain Connection instances --
DBCP provides its own pooling, so it will work with *any* JDBC driver.
> Isn't it like the commons logging factory which recognizes log4j or
> java.util.Logging
You could always look at the sources to answer questions like this :-).
> Thanks,
> Mohan
Craig
>
> -----Original Message-----
> From: Craig R. McClanahan [mailto:craigmcc@apache.org]
> Sent: Tuesday, January 07, 2003 10:03 AM
> To: Struts Users Mailing List; nick@fieldstonesolutions.com
> Subject: Re: linking a struts application to a jndi resource through a
> datasource
>
>
>
>
> On 6 Jan 2003, Nick Torenvliet wrote:
>
> > Date: 06 Jan 2003 22:46:26 -0500
> > From: Nick Torenvliet <ni...@fieldstonesolutions.com>
> > Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>,
> > nick@fieldstonesolutions.com
> > To: Struts Users Mailing List <st...@jakarta.apache.org>
> > Subject: linking a struts application to a jndi resource through a
> > datasource
> >
> > Hi, So I've got two pieces, on one side a working mysql struts data
> > source example, on the other side a working tomcat 4.1 servlet.xml
> > configured jndi resource linked to a mysql data base. I want to access
> > the jndi from inside of struts, can I configure a data source to link to
> > the jndi resource, if so should I be including any special name or key
> > parameters in the datasource, or give it a special type?
> >
>
> If you want to use JNDI-based data sources, you don't need *anything* in
> struts-config.xml, and you would use the standard JNDI programming logic
> to utilize it. See the following docs for more info:
>
> http://jakarta.apache.org/tomcat-4.1-doc/jndi-resources-howto.html
> http://jakarta.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html
>
> Although the mechanism for configuring a JNDI data source in your
> container is container-specific, the setup of your web.xml file (i.e. a
> <resource-ref> element) and the code to access it (getting the
> InitialContext and so on) is portable.
>
> Use *either* the Struts <data-source> *or* JNDI. Not both.
>
> Craig
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>