67,549
社区成员




- package helloworld;
- import java.util.Properties;
- import javax.naming.Context;
- import javax.naming.InitialContext;
- public class HelloClient {
- public static void main(String[] args) throws Exception{
- Properties props=System.getProperties();
- Context ctx=new InitialContext(props);
- Object obj=ctx.lookup("examples.ejb21.HelloHome");
- HelloHome home=(HelloHome) javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
- Hello hello=home.create();
- System.out.println(hello.hello());
- hello.remove();
- }
- }