dcsimg
How to connect to other system using JNDI
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   raja_raja
Posted On:   Wednesday, January 11, 2006 07:27 AM


Hi,



The below code is used to connect to the same system using JNDI.



ServiceBean bean = (ServiceBean)ctx.lookup("ejb.serviceBean");



To connect to the Other system what will be the code used. When i surfed thru the net, i got the above format alone.



Thanks in advance.



Re: How to connect to other system using JNDI

Posted By:   ankush_purwar  
Posted On:   Wednesday, January 11, 2006 02:48 PM

JNDI is used to loacte the services on a particular server or not. It doesn't provide the way to connect to the remote box.
You can connect to remote box by using InitialContext object. When you are making object of Context at that time you can pass the so many properties like
initialcontextfactory , URL(Of server machine) (Try to see constants defined by Context Interface in java docs where you will find like PROVIDER_URL.

I hope you understands now.
About | Sitemap | Contact