WebSphere Application Server Network Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Defining data sources for entity beans

Before you begin

Create a data source or JDBC resource and give it a Java Naming and Directory Interface (JNDI) name.

Why and when to perform this task

Before an application that is installed on an application server can start, all enterprise bean (EJB) references and resource references defined in the application must be bound to the actual artifacts (enterprise beans or resources) defined in the application server. For more information, see Application bindings.

The following steps assume that the entity beans in your application are container managed persistence (CMP) enterprise beans. The EJB container handles the persistence of the bean attributes in the underlying persistent store. You must specify which data store is used. You do this by binding an EJB module or individual EJB to a data source.

If you bind an EJB module to a data source, all beans in that module use the same data source for persistence. If you specify the data source at the bean level, then that data source is used instead.

Steps for this task

  1. Start the Application Server Toolkit.
  2. Optional: Open the J2EE perspective to work with J2EE projects. Click Window > Open Perspective > Other > J2EE.
  3. In the J2EE view, select the EJB module or individual EJB to open its deployment descriptor.
  4. Find the WebSphere bindings section.
  5. In the JNDI name field, enter the name of the data source or JDBC resource you want to use.
  6. Specify whether the authentication is handled at the container or application level.
  7. Save the deployment descriptor.



Related concepts
Application bindings

Related tasks
Binding EJB and resource references
Binding Web modules to virtual hosts

Task topic    

Terms of Use | Feedback

Last updated: Mar 17, 2005 4:28:29 AM CST
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tejb_defdata.html

© Copyright IBM Corporation 2002, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)