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"/>   
  • 相关阅读:
    hadoop无法启动常见原因
    mahout版本兼容问题
    递归打印字符串
    斐波那契数列
    int('x', base)中的base参数
    打印的特殊符号
    位置参数,默认参数,非关键字可变长参数,关键字可变长参数
    try...except包含try...finally方法
    7.9 未解答
    对集合应用符号 | & ^
  • 原文地址:https://www.cnblogs.com/zfxJava/p/5660440.html
Copyright © 2011-2022 走看看