InitialContext Values for Tomcat?
843854Jan 5 2005 — edited Jan 25 2007Hi.
I've successfully accessed a MySQL database via a DataSource from a servlet that makes use of a DAO. I would now like to use the same DAO to access the database from a standalone, command window program.
In order to achieve the above, it appears that I need to set the initial context by supplying the appropriate values for Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL in my Tomcat 5 container. Though I know the values for the corresponding WebLogic container(viz., "weblogic.jndi.WLInitialContextFactory" and "t3://localhost:7001"), I don't know the Tomcat values. Does anybody know these values??
As a subsidiary question, does anybody know the 'safe' way of setting these values? (Attempting the call the 'put' method of the Hashtable object that will be used as the argument to the constructor for InitialContext generates 'unsafe' messages in my J2SE 1.5.0/5.0 compiler.)
Many thanks in anticipation.
Cheers.
Jan