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"/>   
  • 相关阅读:
    AFNetWorking网络库教程
    安卓教程
    HTML5学习教程
    PHP学习教程汇总
    关于cocos2d-x 诸类的详解
    cocos2d-x 学习资料(很全)
    关于IOS开发知识的总结
    叶子效果
    ios后台下载
    ios中webservice报文的拼接
  • 原文地址:https://www.cnblogs.com/zfxJava/p/5660440.html
Copyright © 2011-2022 走看看