tomcat工程数据库链接配置
来源:互联网 发布:丸子地球 知乎 编辑:程序博客网 时间:2024/05/17 01:30
除了相关的类库需要安装之外。还需要修改的有两个文件 : Tomcat->conf->下的两个文件:
contxext.xml 和 server.xml 两个xml文件,其中context.xml配置如下:
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<ResourceLink name="jdbc/edudb" global="jdbc/edudb" type="javax.sql.DataSource"/>
</Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<ResourceLink name="jdbc/edudb" global="jdbc/edudb" type="javax.sql.DataSource"/>
</Context>
server.xml主要是配置数据库链接源的,有两种配置方式:为每一个工程配一个数据源,或者为所有的工程配一个公共数据源。后者配置如下:
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<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/edudb" auth="Container" type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@databaseIpAddress:portNum:oracleInstanceName"
username="userName" password="password" maxActive="10" maxIdle="5"
maxWait="1000" removeAbandoned="true" removeAbandonedTimeout="120"/>
</GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<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/edudb" auth="Container" type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@databaseIpAddress:portNum:oracleInstanceName"
username="userName" password="password" maxActive="10" maxIdle="5"
maxWait="1000" removeAbandoned="true" removeAbandonedTimeout="120"/>
</GlobalNamingResources>
这个配置是池链接的方式,基本上就这两个文件了。
- tomcat工程数据库链接配置
- 配置数据库链接池 tomcat
- Tomcat下配置数据源链接数据库
- Tomcat下配置Mysql数据库链接池(DBCP)
- tomcat 数据库链接池
- JavaWeb-Tomcat链接数据库
- tomcat链接数据库
- Tomcat数据源链接数据库
- tomcat 配置https链接
- tomcat 配置下载链接
- CMake配置工程链接库
- tomcat去掉链接后面的工程名
- jsp+tomcat+ 创建工程 配置工程
- tomcat6 数据库链接配置
- 配置,链接access数据库
- tomcat6 数据库链接配置 .
- 数据库配置链接
- tomcat 工程指向配置方法
- ASP.NET常用代码
- TCP/IP Winsock编程要点
- java面试常见问题
- 各种网页播放器代码大全
- SQL 开平方
- tomcat工程数据库链接配置
- MBA案例分析(人员培训五)
- 我喜欢的或者觉得有道理的话(会经常更新)
- ASP.net下的前台日历控件源代码(不刷新页面)
- GridView行选择事件,单击GridView中某一行任意位置提出这条记录
- TreeView存储过程动态绑定树控件
- ArcGIS 9.0 Desktop 安装步骤以及安装错误解决方法
- Regsvr32使用
- 一个随机数算法