This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with InitialContext!!

 
Saiprasad Natarajan
Greenhorn
Posts: 12
Eclipse IDE Java Oracle
  • 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
  • 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