有关CMP2.0的问题!

javaboy328 2004-08-29 05:52:29
我用JBuilderX开发了CMP2.0,并自己加了一个Finder方法为findAll它的Query:SELECT OBJECT(o) FROM St o,返回java.util.Collection接口都是Home,请教客户程序如何调用findAll,并显示出全部的数据!Thanks
...全文
70 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
superyiman 2004-08-29
  • 打赏
  • 举报
回复
1.jb自带客户端测试ejb test client
2.
try {
//get naming context
Context context = getInitialContext();

//look up jndi name
Object ref = context.lookup("ParticipantRemote");
//look up jndi name and cast to Home interface
participantRemoteHome = (ParticipantRemoteHome) PortableRemoteObject.narrow(ref, ParticipantRemoteHome.class);
if (logging) {
long endTime = System.currentTimeMillis();
log("Succeeded initializing bean access through Home interface.");
log("Execution time: " + (endTime - startTime) + " ms.");
}
}

private Context getInitialContext() throws Exception {
String url = "t3://kkk: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) {
log("Unable to connect to WebLogic server at " + url);
log("Please make sure that the server is running.");
throw e;
}
}


一些set get方法之类

public static void main(String[] args) {
ParticipantTestClient1 client = new ParticipantTestClient1();
}

3.在其它文件中这么调用
ParticipantTestClient1 client = new ParticipantTestClient1();

client.xx();


javaboy328 2004-08-29
  • 打赏
  • 举报
回复
最好给个调用的代码,多谢!

67,550

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧