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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to