I tried that, too, and still get a NameNotFound exception. "jdbc is not bound in this Context"
-----Original Message----- From: Bob Hall [mailto:[email protected]] Sent: Thursday, March 18, 2010 5:07 PM To: Tomcat Users List; [email protected] Subject: Re: DB connection error -Tomcat 6 config --- On Thu, 3/18/10 at 3:02 PM, Pid <[email protected]> wrote: > > Context envCtx = initCtx.lookup("java:comp/env"); > DataSource ds = initCtx.lookup("jdbc/myoracle"); > > should be: > > Context envCtx = initCtx.lookup("java:comp/env"); > DataSource ds = envCtx.lookup("jdbc/myoracle"); > > no? > I was wondering why envCtx was discarded and was about to suggest: DataSource ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/myoracle"); - Bob --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
