Wei�b�ck Maximilian (16) wrote:
> 
> I use the following code (from the JOnAS doc)
> to get the DataSource in a SessionBean
> 
>   Properties env = ctx.getEnvironment(); // ctx is the EntityContext
>   String dataSourceName = env.getProperty("datasource.name");
>   dataSource = (DataSource)initialContext.lookup(dataSourceName);
> 
> Problem is, that "ctx.getEnvironment()" is a deprecated
> methode. So what is the correct way to get the DataSource?
> 

Hello

On EJB 1.0, the bean's environment properties is obtain
by the way of the bean context.
        (Cf javax.ejb.EJBContext.getEnvironment())

On EJB 1.1, the bean's environment is obtain through JNDI.
You can find a such example in the Enterprise JavaBeans
Specification v1.1, chapter 14: Enterprise bean environment.
(this EJB 1.1 feature is not already done in the current
version of JOnAS (1.5))

Best regards.
H�l�ne.
-- 
-=- H�l�ne JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  mailto:[EMAIL PROTECTED]    http://www-frec.bull.com
  Phone: 33.4.76.29.73.53          Fax: 33.4.76.29.76.00
 Download our EJB Server JOnAS at http://www.bullsoft.com/ejb
_______________________________________________________________

Reply via email to