0
我有一个应用程序在Tomcat上。它使用mysql进行持久化。我在context.xml中定义MySQL连接相关数据如下:我在哪里把tomcat context.xml数据放在JBoss EAP 7.0.0中?
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
<Resource
auth="Container"
description="User database that can be updated and saved"
name="jdbc/VTREProto"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
removeAbandoned="true"
username="vtreapp"
password="[email protected]#$%"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/developermodule"
/>
</Context>
我访问这在我的Java代码:
InitialContext initCTX = new InitialContext();
// Lookup the DataSource, which will be backed by a pool
// that the application server provides.
pool = (DataSource)initCTX.lookup("java:comp/env/jdbc/VTREProto");
我要迁移到JBoss EAP 7.0.0。如何以及如何在JBoss EAP 7.0.0中指定上述资源而不破坏我的Java代码。
感谢和问候