Tomcat 配置JNDI

来源:互联网 发布:绵阳涪城编程培训学校 编辑:程序博客网 时间:2024/05/17 01:53
server.xml文件
<GlobalNamingResources>
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<Resource 
name="UserDatabase" 
auth="Container" 
type="org.apache.catalina.UserDatabase" 
description="User database that can be updated and saved" 
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<Resource 
name="jdbc/test1" 
type="javax.sql.DataSource"
auth="Application"
username="test1" 
password="test1" 
driverClassName="com.ibm.db2.jcc.DB2Driver"
maxActive="3"
maxIdle="2"
maxWait="50"
url="jdbc:db2://127.0.0.1:60000/test1" />
  </GlobalNamingResources>
context.xml
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <ResourceLink name="jdbc/test" global="jdbc/picpDataSource" type="javax.sql.DataSource"/>
</Context>
0 0
原创粉丝点击