How can we configure JNDI using tomcat server similar to JBoss server using jboss-web.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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With