请教ejb中初始化上下文的使用,谢谢!

xuancao xuancao 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
请问一下,在初始化环境变量的时候,什么情况下需要设定初始参数--(properties) ,谢谢!
String url = "t3://localhost: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);
}
Contect ctx = new InitialContext(properties);
...全文
评论 8
收藏 已收藏
分享
返回顶部
xuancao
Java EE 67,535 成员 225,843 内容