You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "David C. Hicks" <dh...@i-hicks.org> on 2005/04/19 23:49:54 UTC

Per Application JNDI/JDBC Configuration

Hi,

I'm trying to configure Tomcat5 with a JNDI resource for a JDBC 
connection that I would like to be specific to the application.  In 
other words, I don't want to have to add anything to "server.xml".  I 
keep reading where this is possible, but haven't seen any clear examples 
of it.  My attempts, thus far, have not been fruitful.  Can anyone give 
me a basic overview of how I might go about doing this?  I don't need 
the details of the resource definition, just wondering where to put the 
resource definition so that when I deploy my application it can be found 
and used.

Thanks,
David


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Per Application JNDI/JDBC Configuration

Posted by "David C. Hicks" <dh...@i-hicks.org>.
Yep.  This is basically the direction I was already headed.  Once I 
deploy my application I do get the JNDI name in the list of DataSources 
(as viewed from the Administration tool), but the data source has no 
parameters.  It almost looks as if Tomcat's loader is ignoring the 
<ResourceParams> tag.  My context.xml file is in the META-INF directory 
just under the document base directory.

Parsons Technical Services wrote:

>For each app you have running you will need a context element in a xml
>file. This should reside in the war. In this file you can setup the
>resource which will be available only to that app. This will still give
>you pooling. If you follow the instructions on the Tomcat site for the
>JDBC How-To that will set things up. The only change is to put the
>elements in with the context fragment in the xml file for your app
>instead of the server.xml. 
>
>Yeah the web site should be changed considering that the preferred way
>to set up app is not to put anything in the server.xml and yet this How
>to has you do just that. Eventually they will get to it.
>
>
>
>
>  
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Per Application JNDI/JDBC Configuration

Posted by Parsons Technical Services <pa...@earthlink.net>.
For each app you have running you will need a context element in a xml
file. This should reside in the war. In this file you can setup the
resource which will be available only to that app. This will still give
you pooling. If you follow the instructions on the Tomcat site for the
JDBC How-To that will set things up. The only change is to put the
elements in with the context fragment in the xml file for your app
instead of the server.xml. 

Yeah the web site should be changed considering that the preferred way
to set up app is not to put anything in the server.xml and yet this How
to has you do just that. Eventually they will get to it.




On Tue, 2005-04-19 at 17:49, David C. Hicks wrote:
> Hi,
> 
> I'm trying to configure Tomcat5 with a JNDI resource for a JDBC 
> connection that I would like to be specific to the application.  In 
> other words, I don't want to have to add anything to "server.xml".  I 
> keep reading where this is possible, but haven't seen any clear examples 
> of it.  My attempts, thus far, have not been fruitful.  Can anyone give 
> me a basic overview of how I might go about doing this?  I don't need 
> the details of the resource definition, just wondering where to put the 
> resource definition so that when I deploy my application it can be found 
> and used.
> 
> Thanks,
> David
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org