bmp中ejb查找数据库的问题

NewStarter 2003-05-26 12:17:57
我的代码是
Context ctx=new InitialContext();
Object objref=ctx.lookup("Account");
AccountHome home=(AccountHome)javax.rmi.PortableRemoteObject.narrow(objref,AccountHome.class);

AccountPK pk=new AccountPK("689");
account=home.findByPrimaryKey(pk);
System.out.println("find id "+account.getName());
是否可以这样写
但是在执行ejbLoad()时出现例外
系统提示:
Context ctx=new InitialContext();
Object objref=ctx.lookup("Account");
AccountHome home=(AccountHome)javax.rmi.PortableRemoteObject.narrow(objref,AccountHome.class);

AccountPK pk=new AccountPK("689");
account=home.findByPrimaryKey(pk);
System.out.println("find id "+account.getName());
请问如何解决?
3ks
...全文
38 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoyuzi 2003-07-08
  • 打赏
  • 举报
回复
是啊,怎么会事
shiyangking 2003-06-17
  • 打赏
  • 举报
回复
up
showcode 2003-05-26
  • 打赏
  • 举报
回复
你的系统提示什么呀?
怎么还是你和程序?

67,550

社区成员

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

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