打印本文 打印本文 关闭窗口 关闭窗口
Tomcat环境下配置oracle数据源的方法
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2846  更新时间:2009/4/22 22:03:31  文章录入:mintao  责任编辑:mintao

Tomcat环境下配置oracle数据源的方法

JB2K5下自带的tomcat jakarta-tomcat-4.1.30为例

 完整版本(PDF文件)请到http://hbird.vicp.net/t-1598.html处下载

 完整版本(PDF文件)请到http://hbird.vicp.net/t-1598.html处下载

 

 

Tomcat45)提供了一个与Java Enterprise Edition应用服务相兼容的JNDI--InitialContext实现实例。它的初始数据设置在$CATALINA_HOME/conf/server.xml文件里。并可能在网页应用环境描述(/WEB-INF/web.xml)里被下列元素引用:

 <resource-ref>--资源参数,一般是数据库驱动程序、JavaMail Session、自定义类工厂等。

 

 

$CATALINA_HOME/conf/server.xml里设置数据库连接池:

 

 

下面是tomcat配置样例的代码,必须放在<Host></Host>之间。

        <!-- Tomcat Examples Context -->

        <Context path="/examples" docBase="examples.war" debug="0"

                 reloadable="true" crossContext="true">

          <Logger className="org.apache.catalina.logger.FileLogger"

                     prefix="localhost_examples_log." suffix=".txt"

              timestamp="true"/>

          <Ejb   name="ejb/EmplRecord" type="Entity"

                 home="com.wombat.empl.EmployeeRecordHome"

               remote="com.wombat.empl.EmployeeRecord"/>

 

 

          <!-- If you wanted the examples app to be able to edit the

               user database, you would uncomment the following entry.

               Of course, you would want to enable security on the

               application as well, so this is not done by default!

               The database object could be accessed like this:

 

 

               Context initCtx = new InitialContext();

               Context envCtx = (Context) initCtx.lookup("java:comp/env");

               UserDatabase database =

                    (UserDatabase) envCtx.lookup("userDatabase");

          -->

<!--

          <ResourceLink name="userDatabase" global="UserDatabase"

                        type="org.apache.catalina.UserDatabase"/>

-->

 

 

 

 

          <!-- PersistentManager: Uncomment the section below to test Persistent

               Sessions.

 

 

               saveOnRestart: If true, all active sessions will be saved

                 to the Store when Catalina is shutdown, regardless of

                 other settings. All Sessions found in the Store will be

                 load

[1] [2] [3] [4] [5]  下一页

打印本文 打印本文 关闭窗口 关闭窗口