tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Propes, Barry L " <barry.l.pro...@citi.com>
Subject RE: DB connection error -Tomcat 6 config
Date Thu, 18 Mar 2010 22:10:34 GMT
I tried that, too, and still get a NameNotFound exception.  "jdbc is not bound in this Context"


-----Original Message-----
From: Bob Hall [mailto:rfhall3@yahoo.com] 
Sent: Thursday, March 18, 2010 5:07 PM
To: Tomcat Users List; pid@pidster.com
Subject: Re: DB connection error -Tomcat 6 config



--- On Thu, 3/18/10 at 3:02 PM, Pid <pid@pidster.com> 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message