no I didn't...:-(
I was going off the globalresources config reference page, wher it lists
the attributes of a <Resource> element as being:
**snip**
The valid attriutes for a <Resource> element are as follows:
Attribute Description
auth
Specify whether the web Application code signs on to the corresponding
resource manager programatically, or whether the Container will sign on
to the resource manager on behalf of the application. The value of this
attribute must be Application or Container. This attribute is required
if the web application will use a <resource-ref> element in the web
application deployment descriptor, but is optional if the application
uses a <resource-env-ref> instead.
description
Optional, human-readable description of this resource.
name
The name of the resource to be created, relative to the java:comp/env
context.
scope
Specify whether connections obtained through this resource manager can
be shared. The value of this attribute must be Shareable or Unshareable.
By default, connections are assumed to be shareable.
type
The fully qualified Java class name expected by the web application when
it performs a lookup for this resource.
**snip**
...and I took this to mean that these were the only valid attributes, as
the provided example only references these attributes. I guess then you
can add the username/password/driverClass/url attributes and they'll be
picked up fine? If that's they case then my mistake, but the doco isn't
very clear on that...
ps - apologies if the above table has disintegrated getting converted to
plain-text...
David Smith wrote:
As far as I'm aware, there is no difference between a <Resource ..../>
element in context.xml and a <Resource ..../> element in a
<GlobalNamingResources>...</GlobalNamingResources> block. Well...
other than the need to use a <ResourceLink .../> to make it available
to an individual webapp. Did you try it and get a failure?
--David
Matthew Kerle wrote:
now that sounds good! the only thing is I don't see how that maps to
a DataSource declaration, the <Resource> element in
<GlobalNamingResources> doesn't seem to allow the full range of
properties that you need to define a database connection, eg -
username/password/driverClassName/url etc...
Where would you define these?
David Smith wrote:
In my experience, a resource is usually only relevant to one
webapp. There's no need to put it in server.xml as a
GlobalNamingResource unless you want that resource available in all
your webapps. Moving the resource to the <Context> block of a
context.xml file also makes it so resources can come and go with
deployment of an individual webapp without restarting tomcat and
disrupting all the webapps.
Developers could define their Resources in the
<GlobalNamingResources> ... </GlobalNamingResources> block of
server.xml and then add a <ResourceLink> element to the context.xml
file. That'll get you out of having database specific information
in the <Context ..../> element. See this page for further details
on that:
http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html
--David
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Matthew Kerle
IT Consultant
Canberra, Australia
Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]