![]() ![]() We can’t share the datasource across multiple applications. The datasource is created by container for the application usage only, so it can’t be used globally. ![]() Same issue comes if your application works in distributed environment or your application needs to be deployed in different testing environments such as QA, IT, PROD etc. Since the context file is bundled with the WAR file, we need to build and deploy new WAR for every small configuration change.The approach is simple but it has some drawbacks We have to define Resource element in the context file and container will take care of loading and configuring it. Application context.xml - This is the easiest way to configure DataSource, all we need is a context.xml file in META-INF directory.Apache Tomcat provide three ways to configure DataSource in JNDI context. This tutorial is aimed to provide Tomcat DataSource JNDI configuration example. This helps us in creating and using DataSource connection pool with just few lines of configuration. Most of the popular servlet containers provide built-in support for DataSource through Resource configuration and JNDI context. For example, connection pool in a web application deployed in a servlet container. Tomcat DataSource JNDIĪctual benefit of DataSource comes when we use it with a JNDI Context. We looked at the JDBC DataSource in the last tutorial and learned how to use that in standalone java application. Welcome to Tomcat DataSource JNDI Example Tutorial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |