config jndi in tomcat6 and work with hibernate
来源:互联网 发布:遗传算法优化 编辑:程序博客网 时间:2024/06/07 11:21
This article describes how to config jndi in tomcat6 and work with hibernate.
step 1) open file context.xml under folder %tomcat_home%/conf,
and add the following settings between <Context> and </Context>
<Resource name="jdbc/leave" auth="Container" type="javax.sql.DataSource"
password="lmsdb1234" username="lms" driverClassName="org.gjt.mm.mysql.Driver"
url="jdbc:mysql://localhost:3306/lmsdb" maxActive="20" maxIdle="1" maxWait="5000"/>
step 2) copy mysql driver file, e.g. mysql-connector-java-5.1.7-bin.jar to folder %tomcat_home%/lib
step 3) open file web.xml for leave project, and add the following settings
<resource-ref>
<description>MySQL DataSource</description>
<res-ref-name>jdbc/leave</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
make sure the refercence name is the same as defined in tomcat config file.
step 4) open hibernate config file and assign the jndi settings
<property name="connection.datasource">
java:/comp/env/jdbc/leave
</property>
- config jndi in tomcat6 and work with hibernate
- Flex 2.0 @ Work in combination with Spring and Hibernate
- Hibernate with Weblogic(jndi)
- Work with KeyChain in IOS
- Jndi and c3p0 in Tomcat
- Both differential and cumulative backup work with compressed option in 11G.
- How does ASM work with RAID where striping and mirroring are already built-in [ID 330398.1]
- Work with MySQL character set and collation
- How Rendering Work (in WebKit and Blink)
- How Rendering Work (in WebKit and Blink)
- Install eclipse and config CDT with ROS
- configure Spring+Hibernate+JPA for work with two databases
- work with multiple languages in your /App_Code folder
- Getting FTP to Work with Ant in Eclipse[转]
- Asynchronous Android读书笔记三Distributing Work with Handler and HandlerThread
- How to work with my desktop and laptop
- Working with Hibernate in Eclipse
- Hibernate Work
- 基于WINCE平台C#编程要点之一
- 最近有点乱
- 第一章 C指针概念
- printf打印图形
- netbox2.8不能运行的原因
- config jndi in tomcat6 and work with hibernate
- Java 5.0 泛型之 通过泛型方法返回泛型类型
- WCF服务离线操作与消息队列MSMQ
- Java 5.0 泛型之 使用泛型统一传入的参数类型
- php_mysqli.dll 的了解
- Ubuntu下Java环境的搭建
- const的用途
- 化零为整WCF(16) - 消息队列(MSMQ - MicroSoft Message Queue)
- Java 5.0 泛型之 Java泛型数组