tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Wulff <ewu...@gmail.com>
Subject DataSource and initialContext.lookup("java:comp/env")
Date Sun, 07 Nov 2004 03:05:12 GMT
I just returned from working on a tutorial at sun which I was inspired
to go over based on my lack of understanding of the code snippet
below.  I'm trying to fully understand what's going on.  Docs state
that the code...

initialContext.lookup("java:comp/env") 

returns a named object.  Best I can tell is that this is a reference
to a starting point in my directory... or something like that.  Is
anyone willing to explain what initialContext.lookup() fundamentally
takes care of when called?

Context initialContext = new InitialContext();
Context context = (Context) initialContext.lookup("java:comp/env");
DataSource dataSource = (DataSource) context.lookup("jdbc/wms");

thx
Eric

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