 |
try
{
// Set up the naming provider. This may not always be necessary,
// depending on how your Java system is configured.
System.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
System.setProperty("java.naming.provider.url",
"localhost:1099");
// Get a naming context
InitialContext jndiContext = new InitialContext();
// Get a reference to the Interest Bean
Object ref = jndiContext.lookup("interest/Interest");
// Get a reference from this to the Bean's Home interface
InterestHome home = (InterestHome)
PortableRemoteObject.narrow (ref, InterestHome.class);
// Create an Interest object from the Home interface
m_interest = home.create();
}
catch(Exception e)
{
out.println("<LI>Context failed: " + e);
}
|
 |