File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with InitialContext!!

 
Saiprasad Natarajan
Greenhorn
Posts: 12
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Does InitialContext() initialize a context to the server where the calling application is deployed?

And if i need the JNDI look up to happen at the current server itself, would new InitialContext() suffice or do i need to specify the environment also?

TIA
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
InitialContext always needs the properties to be set, but if you look at the javax.naming.Context API there are multiple ways to specify these properties.
You can define them explicitly and pass them to the constructor, otherwise (as in your case) the default values can be defined as environent variables or as a resource file (on the file system)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic