通过远程接口
还是通过JNDI来调用
/////////////////////代码如下
private Context getD_InitialContext() throws Exception {
String url = D_url;// "t3://192.168.0.117:7001";
String user = null;
String password = null;
Properties properties = null;
try
{
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null)
{
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
}
return new InitialContext(properties);
}
catch(Exception e)
{
throw e;
}
}
public R_SbZzsXgmnsr getR_SbZzsXgmnsr()
{
try
{
Context context = getD_InitialContext();
Object ref = context.lookup("R_SbZzsXgmnsr");
R_SbZzsXgmnsrHome home = (R_SbZzsXgmnsrHome)PortableRemoteObject.narrow(ref, R_SbZzsXgmnsrHome.class);
R_SbZzsXgmnsr xtreturn = home.create();
return xtreturn;
}
catch (Exception e)
{
return null;
}
}