zoukankan      html  css  js  c++  java
  • tomcat JNDI 设置

    一、在Spring配置文件中的配置
      <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName">
                <value>java:comp/env/jndi/mybatis</value>
            </property>
        </bean>

    二、在项目中web.xml的配置(这些标签就是用来建立当前应用环境到服务器资源的映射的)

      <resource-ref>

      <description>JNDI DataSource</description>
      <res-ref-name>jndi/mybatis</res-ref-name>
      <res-ref-type>javax.sql.DataSource</res-ref-type>
      <res-auth>Container</res-auth>
    </resource-ref>

    三、在conf 中context.xml  

    <Resource name="jndi/mybatis" 
                    auth="Container" 
                    type="javax.sql.DataSource" 
                    driverClassName="com.mysql.jdbc.Driver" 
                    url="jdbc:mysql://localhost:3306/3dback" 
                    username="root" 
                    password="123456" 
                    maxActive="20" 
                    maxIdle="10" 
                    maxWait="10000"/>   
  • 相关阅读:
    RabbitMQ简介、特性、使用场景、安装、启动与关闭
    mybatis的工作原理
    bzoj2119 股市的预测
    Noi2014 购票
    51Nod 算法马拉松22 开黑记
    COGS2485 从零开始的序列
    Codeforces Round #402 (Div.2)
    BestCoder Round #92
    COGS2294 释迦
    bzoj4764 弹飞大爷
  • 原文地址:https://www.cnblogs.com/zfxJava/p/5660440.html
Copyright © 2011-2022 走看看