Please have a look

http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

Thanks;

--Gurkan

2010/3/18 Narahari 'n' Savitha <savith...@gmail.com>

> Friends:
>
> I have the following setup.
>
> A Jar file with a class called DBConnectionUtil that reads a specific
> string
> for lookup "jdbc/windsDS".
>
> This jar is being used inside of Websphere7 and it works fine.
>
> Inside of Tomcat 6, the same context look up for the jndi of jdbc/windsDS
> does NOT work.
>
> Tomcat expects
>
> Context parentcontext = new InitialContext();
> Context childContext = parentcontext.lookup("java:comp/env");
> Datasource ds = childContext.lookup("jdbc/windsDS");
>
> All the xml entries are right since the above snippet works.
>
> I want to make the direct global look up  aka jdbc/windsDS to work.
>
> Context parentcontext = new InitialContext();
> Datasource ds = context.lookup("jdbc/windsDS");
>
> Is there a way to do jndli direct global lookup ?
>
> -Narahari
>



-- 
Gurkan Erdogdu
http://gurkanerdogdu.blogspot.com

Reply via email to