Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / June 2005

Tip: Looking for answers? Try searching our database.

lookup question

Thread view: 
Rizwan - 15 Jun 2005 16:34 GMT
I have a JNDI named "MSSQLDS".

String jndiName = "MSSQLDS;
Context ctx =  new InitialContext();

What is the difference between these 2 statements :

DataSource ds = (DataSource) ctx.lookup( "java:/" + jndiName );
or
DataSource ds = (DataSource) ctx.lookup( "java:comp/env/jdbc/" + jndiName );

How can I make sure which one will work for the jndiName?

Thanks

Rizwan
Volker - 20 Jun 2005 20:27 GMT
The first syntax is the old syntax. With the first syntax you can access the
global namespace. This is not available for all application servers. With
the second syntax you access the the mapped names of the Bean. You should
repeat your question in a forum to EJB

Signature

http://www.smallsql.de - the 100% pure Java DBMS with JDBC interface for
desktop applications

>I have a JNDI named "MSSQLDS".
>
[quoted text clipped - 13 lines]
>
> Rizwan


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.