tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Hall <rfha...@yahoo.com>
Subject Re: DB connection error -Tomcat 6 config
Date Thu, 18 Mar 2010 22:06:53 GMT


--- 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


Mime
View raw message