配置全局数据库连接池:
conf/server.xml
<GlobalNamingResources>
<Resource name="jdbc/abc"
auth="Container"
type="oracle.jdbc.pool.OracleDataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
url="jdbc:oracle:thin:@localhost:1521:orcl"
user="222"
password="2222"
maxActive="20"
maxIdle="10"
maxWait="-1" />
</GlobalNamingResources>
conf/context.xml
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<ResourceLink global="jdbc/abc" name="jdbc/cde" type="javax.sql.DataSource"/>
</Context>
web.xml
<resource-ref>
<description>DataSource Reference</description>
<res-ref-name>jdbc/cde</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
spring配置文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/cde" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="jdbcExtractor"
class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"
lazy-init="true">
</bean>
</beans>
分享到:
相关推荐
Tomcat5的数据库连接池配置Tomcat5的数据库连接池配置Tomcat5的数据库连接池配置Tomcat5的数据库连接池配置Tomcat5的数据库连接池配置Tomcat5的数据库连接池配置Tomcat5的数据库连接池配置Tomcat5的数据库连接池配置...
tomcat数据库连接池配置网上文章&csdn上的代码tomcat数据库连接池配置网上文章&csdn上的代码tomcat数据库连接池配置网上文章&csdn上的代码tomcat数据库连接池配置网上文章&csdn上的代码tomcat数据库连接池配置网上...
Tomcat服务器配置及数据库连接池配置(个人整理版)。纯粹个人整理意见。
tomcat数据库连接池配置.TXTtomcat数据库连接池配置.TXTtomcat数据库连接池配置.TXTtomcat数据库连接池配置.TXT
tomcat配置数据库连接池,本次以MYSQL为例
TOMCAT数据库连接池配置说明文档,讲解很清楚。不知道的可以看看哦
tomcat数据库连接池的使用
Tomcat数据库连接池 几种常见的配制方法
tomcat 连接数据库的jar包 commons-dpcp.jar ,commons-pool.jar 配置好了,就能解决连接池配置方面的问题
tomcat数据库连接池设置 tomcat数据库连接池设置
TOMCAT数据库连接池TOMCAT数据库连接池TOMCAT数据库连接池TOMCAT数据库连接池
Tomcat数据库连接池的配置和实例,采用简单的页面配置方法。
Tomcat连接池配置,包你学会tomcat连接池的使用
TOMCAT中数据库连接池的几种配置方法
数据库连接池配置终极指南,详细介绍了tomcat的部署流程
Tomcat数据库连接池的配置方法总结.docx
tomcat配置数据库连接池 tomcat配置数据库连接池
tomcat连接池的配置与性能测试