Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Container managed data bases (MySQL)
Container managed data bases (MySQL) [message #109366] Fri, 03 June 2005 12:57 Go to next message
Eclipse UserFriend
Originally posted by: apollyon.ya.com

Hi,

I'm using WTP 1.0M4 with a Tomcat 5 server, but I can't figure out
how to access a data base. As far as I know, if I were using a
standalone Tomcat, I would copy a XML file to
{tomcathome}/conf/Catalina/localhost with something like the following:

<Resource name="jdbc/tienda" type="javax.sql.DataSource"
auth="Container" />
<ResourceParams name="jdbc/tienda">
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
etc.

Now, I've seen that WTP creates its own Tomcat config in
{workspace}/.metadata/.plugins/org.eclipse.wst.server.core/t mp0, and
this includes de conf/Catalina/localhost folder, with a .xml file
for my webapp. The problem is I can't touch that file because WTP
overwrites it every time my proyect is deployed.

How can I tell WTP to use my own xml file? Is there another way of
doing this?

TIA,
Alex
Re: Container managed data bases (MySQL) [message #109386 is a reply to message #109366] Fri, 03 June 2005 13:46 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
At the moment, the best way is to create a META-INF/context.xml file in
the WebContent portion of your webapp. The children of the <Context>
element in this file will be included in the <Context> element included
in the tmp0/conf/server.xml file.

The creation of the context file under tmp0/conf/Catalina/localhost is a
"quirk" of Tomcat 5.0. The <Context> in the server.xml takes precedence
over the one under "localhost".

Cheers,
Larry

Alex Iribarren wrote:
> Hi,
>
> I'm using WTP 1.0M4 with a Tomcat 5 server, but I can't figure out
> how to access a data base. As far as I know, if I were using a
> standalone Tomcat, I would copy a XML file to
> {tomcathome}/conf/Catalina/localhost with something like the following:
>
> <Resource name="jdbc/tienda" type="javax.sql.DataSource"
> auth="Container" />
> <ResourceParams name="jdbc/tienda">
> <parameter>
> <name>driverClassName</name>
> <value>com.mysql.jdbc.Driver</value>
> </parameter>
> etc.
>
> Now, I've seen that WTP creates its own Tomcat config in
> {workspace}/.metadata/.plugins/org.eclipse.wst.server.core/t mp0, and
> this includes de conf/Catalina/localhost folder, with a .xml file
> for my webapp. The problem is I can't touch that file because WTP
> overwrites it every time my proyect is deployed.
>
> How can I tell WTP to use my own xml file? Is there another way of
> doing this?
>
> TIA,
> Alex
Re: Container managed data bases (MySQL) [message #109399 is a reply to message #109386] Fri, 03 June 2005 14:34 Go to previous message
Eclipse UserFriend
Originally posted by: apollyon.ya.com

Thanks a lot, Larry, that works beautifully!

Larry Isaacs wrote:
> At the moment, the best way is to create a META-INF/context.xml file in
> the WebContent portion of your webapp. The children of the <Context>
> element in this file will be included in the <Context> element included
> in the tmp0/conf/server.xml file.
>
> The creation of the context file under tmp0/conf/Catalina/localhost is a
> "quirk" of Tomcat 5.0. The <Context> in the server.xml takes precedence
> over the one under "localhost".
>
> Cheers,
> Larry
>
> Alex Iribarren wrote:
>
>> Hi,
>>
>> I'm using WTP 1.0M4 with a Tomcat 5 server, but I can't figure out
>> how to access a data base. As far as I know, if I were using a
>> standalone Tomcat, I would copy a XML file to
>> {tomcathome}/conf/Catalina/localhost with something like the following:
>>
>> <Resource name="jdbc/tienda" type="javax.sql.DataSource"
>> auth="Container" />
>> <ResourceParams name="jdbc/tienda">
>> <parameter>
>> <name>driverClassName</name>
>> <value>com.mysql.jdbc.Driver</value>
>> </parameter>
>> etc.
>>
>> Now, I've seen that WTP creates its own Tomcat config in
>> {workspace}/.metadata/.plugins/org.eclipse.wst.server.core/t mp0, and
>> this includes de conf/Catalina/localhost folder, with a .xml file
>> for my webapp. The problem is I can't touch that file because WTP
>> overwrites it every time my proyect is deployed.
>>
>> How can I tell WTP to use my own xml file? Is there another way of
>> doing this?
>>
>> TIA,
>> Alex


---
Brooklyn Aquarium, special exhibit: boids of da wattah
Previous Topic:JSP Location Within Web Project
Next Topic:Create web service for external server
Goto Forum:
  


Current Time: Thu Sep 19 06:43:35 GMT 2024

Powered by FUDForum. Page generated in 0.03303 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top