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"/>   
  • 相关阅读:
    bash特性
    FHS 层级文件系统
    环境变量的问题
    linux认识
    搜索引擎的使用
    nginx
    部署操作手册
    git
    添加tag
    pycharm中使用git
  • 原文地址:https://www.cnblogs.com/zfxJava/p/5660440.html
Copyright © 2011-2022 走看看