开发者

How can we configure JNDI using tomcat server?

开发者 https://www.devze.com 2023-01-24 08:51 出处:网络
How can we configure JNDI using tomcat server similar to JBoss server using jboss-we开发者_StackOverflow中文版b.xml?

How can we configure JNDI using tomcat server similar to JBoss server using jboss-we开发者_StackOverflow中文版b.xml? Please help me on this?

I want to know which file we need to write it? or is there any programmatic way to do this?

Thanks in Advance, Pravin


Write a context.xml

 <Context>
   <Resource name="jdbc/dbConnection" 
    auth="Container" 
    type="javax.sql.DataSource"
    driverClassName="com.mysql.jdbc.Driver" 
    url="j<url to database>" 
    username="user" 
    password="pwdt" 
    validationQuery="select 1" 
    removeAbandoned="true"
    removeAbandonedTimeout="120" 
    maxWait="60" 
    maxActive="20" 
    maxIdle="10" /> 
   </Context>


Here's a JNDI HOWTO from Apache on how to configure JNDI on Tomcat 6.

  • Related topic.


If you want a JNDI data source or something else, read the docs. They are quite detailed.

0

精彩评论

暂无评论...
验证码 换一张
取 消