Hi all,
I am using Data base connection pooling . I am using a JNDi lookup from my code .
I am making the following entry in web.xml
<resource-ref>
<description>My Connection</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
Also putting the following entry in the conext.xml
<Resource
auth="Container"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxActive="20"
maxIdle="10"
maxWait="-1"
name="jdbc/TestDB"
password="aa"
type="javax.sql.DataSource"
url="<some db url>"
username="aa"/>
And i am a using the following
java code fro accessing the JNDI resource
Context ctx = new InitialContext();
ds =(DataSource) ctx.lookup("java:comp/env/jdbc/TestDB");
conn = ds.getConnection();
Now the problem is if I comment the web.xml entry then the code is still running Then what is the use of putting it in web.xml ???
Thanks in advance.