Thanks again for making this so crystal clear! I modified my code as you suggested and it works fine. I just want to make sure I understand the concept here.
"comp" is the root of the JNDI tree and "env" are the settings you've configured in the context.xml file. Then your data source instance is located under the name you specified.
This would mean in a typical JNDI setting, I would always start any lookup by setting the root of the JNDI tree (ie: specifiying the env settings by extending the Context class). Correct?
In my modified code I did have to change the Datasource libraries from org.apache.tomcat.jdbc.pool.DataSource to org.apache.tomcat.dbcp.dbcp.BasicDataSource. When I used the pool.DataSource, I got:
java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to org.apache.tomcat.jdbc.pool.DataSource
Is this because of a conflict in the class libraries? Can you tell me the difference between using the two libraries or should I post seperately about that topic? If I did want to use DataSource, is there a workaround such as explicit definition of the Datasource library?
Thanks