JSPservlet connection EJB code

zhaozj2021-02-16  72

Hashtable environment = new hashtable ();

Environment.put (context.initial_context_factory, "org.jnp.interfaces.namingContextFactory);

Environment.put (context.url_pkg_prefixes, "org.jboss.naming: org.jnp.interface");

Environment.put (Context.Provider_URL, "JNP: // localhost: 1099");

Context ctx = new InitialContext (); Object ref = ctx.lookup ( "Usertest"); UsertestHome uth = (UsertestHome) PortableRemoteObject.narrow (ref, UsertestHome.class); Usertest ut = uth.create ();

转载请注明原文地址:https://www.9cbs.com/read-12983.html

New Post(0)