Show TOC Start of Content Area

Procedure documentation Declaring Resource References  Locate the document in its SAP Library structure

Use

Use this procedure to declare the enterprise bean’s references to external resources, and to administered objects associated with resources in the enterprise bean’s environment.

Procedure

...

       1.      Open the ejb-jar.xml

       2.      From the right-hand pane, choose the Enterprise Beans tab

       3.      Open the corresponding tree structure according to the type of your enterprise bean (session, entity, or message-driven)

       4.      From your bean tree sub-structure, select resource-ref (to declare a reference to an external resource) or resource-env-ref (to declare a reference to an administered object associated with a resource in the enterprise bean’s environment)

       5.      Choose Add

       6.      Enter the following data:

Resource References

Property

Description

Resource Reference Name

The name of the resource manager connection factory reference. This name must be unique within the enterprise bean. The name must be a JNDI name relative to the java:comp/env context.

Resource Type

The type of the data source. You can choose a standard Java language class or interface. This type is expected to be implemented by the data source.

Resource Authentication

Choose between Container (the EJB Container will sign on to the resource manager on behalf of the enterprise bean) and Application (the enterprise bean code signs on programmatically to the resource manager).

Resource Sharing Scope

Specifies whether the connections obtained through this resource manager connection factory reference can be shared. For more information, see Sharing Connections.

Description

A description of the resource reference.

 

Resource Environment References

Property

Description

Description

A description of the resource environment reference.

Resource Environment Reference Name

The name of the resource environment reference. The value of this field must be the environment entry name that is used in the enterprise bean code, and must be unique within the bean. This name must be a JNDI name, relative to the java:comp/env context.

Resource Environment Reference Type

The type of the resource environment reference.

 

The declared reference appears as sub-node under the resource-ref or the resource-env-ref node correspondingly.

Note

To remove a declared reference, select it and choose Remove.

       7.      In the ejb-j2ee-engine.xml, specify the JNDI name of the referenced resource. For more information, see Specifying JNDI Names for the Beans References.

 

 

End of Content Area