1

我想声明JNDI用于访问Mysql数据库的全局资源,com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource如此处所述http://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html

据说可以编辑Context.xml

但它看起来像 Eclipse 覆盖Context.xml。我应该修改Context.xml位于Servers我的工作区文件夹中的那个吗?

我可以修改全局server.xml以使所有应用程序都可以访问数据库吗?或者它会被 Eclipse 的覆盖?

我还读到Context.xml可以放入 int META-INF。我在哪里可以阅读有关处理此位置的机制的信息?

4

1 回答 1

3

建议将 context.xml 放在 Web 应用程序的 META-INF/context.xml 下。

于 2012-02-08T18:25:56.650 回答