×

Loading...

一个EJB的问题

ren (tom)
我从两个不同的地方看到几个EJB互相调用和EJB调用其他resouce的例子, 例如:
EJB调用EJB:
InitialContext initial = new InitialContext();
finCalc.stateless.FinancialNeedCalculatorHome home =
(finCalc.stateless.FinancialNeedCalculatorHome)
javax.rmi.PortableRemoteObject.narrow(
initial.lookup("java:comp/env/ejb/CalculatorService"),
finCalc.stateless.FinancialNeedCalculatorHome.class);

EJB调用DataSource :
Context initial = new InitialContext();
DataSource dataSource =
(DataSource)initial.lookup("java:comp/env/jdbc/sportsJDBC");

我发现在initial.lookup中都有"java:comp/env/", 无一例外, 我想这不是巧合, 那么是sun的硬性规定吗? 若是, 谁能告诉我它的出处在哪?或者相关线索.
(#352982@0)
2002-1-30 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: 一个EJB的问题

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论