tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kelly C. Goedert" <kelly.goed...@nexxera.com>
Subject Re: Name jdbc is not bound in this Context
Date Thu, 09 Sep 2004 14:08:51 GMT
I fixed this on the code and it still didn't work. I put my datasource 
as a global resource and used <ResourceLink> than the error stoped. But 
when it is not global it doesn't, I don't know why.

Kelly.


Shapira, Yoav wrote:

>Hi,
>
>  
>
>>I'm getting this error " Name jdbc is not bound in this Context" on my
>>application. My tomcat version is 5.0.27.
>>
>>The servlet that is causing this error is trying to access a database
>>with the following code:
>>
>>protected IDatabaseConnection getConnection() throws Exception {
>>
>>       Context ic = new InitialContext();
>>       Context ctx = (Context) ic.lookup("java:comp/env");
>>       DataSource ds = (DataSource) ic.lookup("jdbc/boxes-cactus");
>>
>>       con = new DatabaseDataSourceConnection( ds);
>>
>>       return con;
>>    
>>
>
>Sometimes people miss the basic things: how about ctx.lookup instead of
>ic.lookup on the 2nd call? ;)
>
>Yoav
>
>
>
>This e-mail, including any attachments, is a confidential business communication, and
may contain information that is confidential, proprietary and/or privileged.  This e-mail
is intended only for the individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the sender.  Thank you.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>  
>


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


Mime
View raw message