Home  >  Article  >  Database  >  JNDI数据源配置注意事项

JNDI数据源配置注意事项

WBOY
WBOYOriginal
2016-06-07 15:56:041333browse

如果是在原有工程上修改 1,applicationContext.xml中修改其中的value bean id=dataSource class=org.springframework.jndi.JndiObjectFactoryBean property name=jndiName valuejava:comp/env/jndivalue/value /property /bean 2,web.xml中修改res-ref-nam

如果是在原有工程上修改
1,applicationContext.xml中修改其中的value值


java:comp/env/jndivalue


2,web.xml中修改res-ref-name

jndivalue
javax.sql.DataSource
Container

3,tomcat中,conf/context.xml中修改或添加

4,tomcat中,conf/server.xml中 中添加
type="com.jolbox.bonecp.BoneCPDataSource"
factory="org.apache.naming.factory.BeanFactory"
driverClass="oracle.jdbc.driver.OracleDriver"
username="" password=""
jdbcUrl=""
idleMaxAge="240"
idleConnectionTestPeriod="60"
partitionCount="3"
acquireIncrement="10"
minConnectionsPerPartition="10"
maxConnectionsPerPartition="20"
releaseHelperThreads="3"/>

这四部分的jndivalue最好是统一的,tomcat和工程的纽带是第三部分,如果想不一样,修改第三部分

如果是新建工程,tomcat也是新的,用这种方式的话,需要往tomcat中导入一些jar包

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn