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处下载 Tomcat4(5)提供了一个与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] 下一页 [系统软件]EXP-00008: ORACLE error 904 encountered的解决方… [常用软件]PB7 连接 Oracle 的配置方法 [Web开发]oracle Export and Import 简介 [Web开发]ADO访问Oracle结果集的心得 [JAVA开发]JDBC+Hibernate将Blob数据写入Oracle [JAVA开发]J2EE应用中与Oracle数据库的连接 [JAVA开发]Oracle Application Serve_ [其他]HP-UXrx2600B.11.22Uia64安装oracle9i9.2foria64手… [其他]在RedhatEnterpriseserver3上安装oracle9iR2的注意… [其他]PROC++批量导入导出ORACLE数据库表
|