Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between Lookup and Import  RSS feed

 
Erik Hu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all
In petStore, Sun let the session bean to look up the DAOS, in my opinion, the difference of lookup and import is that if the daos and ejbs will be put on one server machine or not. Am I right? Cause Lookup waster much more time than import, so I if I just put the ejbs and daos into one server machine, it is not necessary to look up daos or such resource, am I right?
 
Ghulam Rashid
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, when we perform the lookup then actually the object is looked up in JNDI tree and compare to imports it offcourse takes much time.
Though I am not sure but In remote machine we must bind it to JNDI tree.
Rashid
 
Subhash Nambiar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Actually import and Lookup r altogether different .
import, we use in our java program to make the class files avilable to the appln for eg if we r using Date class of the util package then we need to write the full name including package i.e java.util.Date wherever we r using Date object it,or just import the file once and use Date later in the program.
while lookup is the method of the initial context which provides a way to find the object bind to the name which is passed as a parameter. And the object which is returned is basically the stub of the remote object.Generally used in client server technology to make the object location transparent.
regards
Subhash
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!