Tomcat5.5 私有JNDI、数据源(链接池)的配置
来源:互联网 发布:怎么查看淘宝卖家等级 编辑:程序博客网 时间:2024/05/16 12:07
可以在两个位置配置JNDI:
1. $CATALINA_HOME/conf/server.xml,在这个文件里的是全局的,对所有应用可见;
2. 应用的context XML文件(META-INF/context.xml),这个是私有的,只对这个应用可见。
大家都知道第一个位置,第二个不熟悉,看看下面的目录结构:
应用目录--
--WEB-INF/web.xml
--META_INF/context.xml
--index.jsp
一个context.xml 文件的例子:
<Context debug="0">
<Resource name="jdbc/rollerdb" auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/数据库?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8"
username="用户"
password="密码"
maxActive="20"
maxIdle="3"
removeAbandoned="true"
maxWait="3000" />
<!-- If you want e-mail features, un-comment the section below -->
<!--
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"
mail.smtp.host="mailhost.example.com" />
-->
</Context>
web.xml资源参考部分的代码:
<!-- Web app resource refs. -->
<resource-ref>
<res-ref-name>jdbc/rollerdb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
1. $CATALINA_HOME/conf/server.xml,在这个文件里的是全局的,对所有应用可见;
2. 应用的context XML文件(META-INF/context.xml),这个是私有的,只对这个应用可见。
大家都知道第一个位置,第二个不熟悉,看看下面的目录结构:
应用目录--
--WEB-INF/web.xml
--META_INF/context.xml
--index.jsp
一个context.xml 文件的例子:
<Context debug="0">
<Resource name="jdbc/rollerdb" auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/数据库?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8"
username="用户"
password="密码"
maxActive="20"
maxIdle="3"
removeAbandoned="true"
maxWait="3000" />
<!-- If you want e-mail features, un-comment the section below -->
<!--
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"
mail.smtp.host="mailhost.example.com" />
-->
</Context>
web.xml资源参考部分的代码:
<!-- Web app resource refs. -->
<resource-ref>
<res-ref-name>jdbc/rollerdb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
- Tomcat5.5 私有JNDI、数据源(链接池)的配置
- Tomcat5.5私有JNDI、数据源(链接池)的配置
- Tomcat5.5数据源的配置(JNDI)
- Tomcat5.0.28下的jndi数据源配置
- Tomcat5.0.28下的jndi数据源配置
- Tomcat5.5下配置JNDI JDBC数据源
- tomcat5.028配置jndi数据源
- Tomcat5.5数据源的配置
- Tomcat5.5数据源的配置
- Tomcat5.5数据源的配置
- Tomcat5.5+数据源的配置
- 2-Tomcat5.5.9配置JNDI数据源
- 在spring+hibernate中使用tomcat5.5的jndi数据源
- Tomcat5.5下的jndi的配置
- Tomcat5.5下的jndi的配置
- Tomcat5.5下的jndi的配置
- Tomcat5.5下的jndi的配置
- Tomcat5.5下的jndi的配置
- 华为中高层缓发年终奖 或为备战电信招标
- 编写QQ显IP外挂插件及原理分析
- 金蝶软件被爆“邮件门”
- 谷歌参与铺设亚洲海底光缆 谋求服务增长
- 在js中定义变量
- Tomcat5.5 私有JNDI、数据源(链接池)的配置
- 软件的架构与设计模式之什么是架构
- 大学生,你被谁抛弃
- Windows CE 的有用网页
- 【转】Symbian C++?
- Asterisk1.4安装指南
- 决定考研
- 无进程无DLL无硬盘文件
- 短信发送程序的编写