tomcat JNDI 设置
2016-07-11 15:34
453 查看
一、在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"/>
<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"/>
相关文章推荐
- Spring Boot 项目发布到 Tomcat 服务器
- CentOS-7.0.中安装与配置Tomcat-7的方法
- 使用visualVM 1.3.8(visualvm_138-ml.zip) 监控远程Tomcat运行情况
- tomcat都是按日保存日志文问分割
- tomcat开发的web项目部署到weblogic注意事项
- Unable to open service Tomcat解决方法
- tomcat 在eclipse中启动报错为端口被占用
- solr5.5 部署TOMCAT
- WEB服务器:Apache、Tomcat、JBoss、WebLogic的区别与关系
- Mac OS上安装Tomcat服务器的简单步骤
- Java后端WebSocket的Tomcat实现
- Linux下三行指令将Tomcat配置成服务及自启动
- 使用tomcat_2——虚拟目录映射
- eclipse项目配置tomcat后浏览器访问不到项目解决方案
- Tomcat 配置 默认应用 (去掉项目名称、移除项目名称)
- Nginx转发给Tomcat页面去掉端口号
- 部署terracotta集群存储tomcat的session
- tomcat 404 问题及解决方法
- 性能测试中用LambdaProbe监控Tomcat
- eclipse远程调试Tomcat方法(测试成功并且说说遇到的坑)