Java Naming and Directory Interface (JNDI) is a Java Application Programming Interface (API) providing naming and directory functionality for Java software clients to discover and look up data and objects via a name. Carbon maintains platform level JNDI resources such as Carbon DataSources, Transaction Manager etc. Applications deployed in WSO2 Application Server (such as, web applications, Axis2 services etc.) can access them using an InitialContext
object.
...
For more details on Tomcat JNDI resources, go to http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html
Webapp
...
level registering
To register a JNDI resource on webapp
...
level, place the JNDI resource in the context.xml
file of the webapp. Since each webapp’s context is isolated from each other, this ensures that the resources will be available to the webapp context only.
Example
Code Block |
---|
<Resource name="jdbc/TestDataSource" auth="Container" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" maxActive="100" maxIdle="30" maxWait="10000" url="jdbc:mysql://localhost:3306/test_db" username="root" password="root"/> |
...