zoukankan      html  css  js  c++  java
  • JNDI数据源配置注意事项

    假设是在原有project上改动
    1,applicationContext.xml中改动当中的value值
    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
         <property name="jndiName">
         <value>java:comp/env/jndivalue</value>
         </property>
     </bean>
    2,web.xml中改动res-ref-name
    <resource-ref>
      <res-ref-name>jndivalue</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
     </resource-ref>
    3,tomcat中,conf/context.xml中改动或加入
    <ResourceLink name="jndivalue" global="jndivalue" type="javax.sql.DataSource"/>

    4,tomcat中,conf/server.xml中 <GlobalNamingResources> </GlobalNamingResources>中加入
    <Resource name="jndivalue" auth="Container"     
       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和project的纽带是第三部分,假设想不一样,改动第三部分

    假设是新建project,tomcat也是新的,用这样的方式的话,须要往tomcat中导入一些jar包

  • 相关阅读:
    开窗函数Over用法
    Linux文件搜索命令
    Linux更改文件或目录的所有者和所有组
    Linux权限管理
    不使用临时变量 交换两个变量值
    jQuery获取区间随机数
    jQuery对checkbox选中和取消选中操作
    MySQL优化
    MySQL中explain的用法
    MySQL中好用的GROUP_CONCAT函数
  • 原文地址:https://www.cnblogs.com/mengfanrong/p/4090357.html
Copyright © 2011-2022 走看看