Appendix B. Example code provided with WebSphere Application Server

This appendix contains information on the example code provided with the WebSphere Application Server for both Advanced Edition and Enterprise Edition.

Information about the examples described in the documentation

The example code discussed throughout this document is taken from a set of examples provided with the product. This set of examples is composed of the following main components:

Note:
The example code in the documentation was written to be as simple as possible. The goal of these examples is to provide code that teaches the fundamental concepts of enterprise bean and EJB client development. It is not meant to provide an example of how a bank (or any similar company) possibly approaches the creation of a banking application. For example, the Account bean contains a balance variable that has a type of float. In a real banking application, you must not use a float type to keep records of money; however, using a class like java.math.BigDecimal or a currency-handling class within the examples would complicate them unnecessarily. Remember this as you examine these examples.

Information about other examples in the EJB server (AE) environment

Table 4 provides a summary of the enterprise bean-specific examples provided with the EJB server (AE).

Table 4. Examples available with the EJB server (AE)

Name Bean types EJB client types Additional information
Hello Stateless session Java servlet Very simple example of a session bean.
Increment CMP entity Java servlet Very simple example of an entity bean.

Information about other examples in the EJB server (CB) environment

Table 5 provides a summary of the enterprise bean-specific examples provided with the EJB server (CB). or more information about these examples, see the README file that accompanies each example.

Table 5. Examples available with the EJB server (CB)

Name Bean types EJB client types Additional information
Hello Stateless session Java application Very simple example of a session bean.
Calculator Stateful session Applet, ActiveX control Demonstrates maintaining state information in a session bean.
Account Stateful session, CMP entity, BMP entity Servlet, Active X control An Advanced Edition sample with a servlet client. One enterprise bean references another bean.
Card Game Stateful session, CMP entity Applet, ActiveX control Demonstrates a session bean selecting entity beans with custom finder methods that use various types of queries. One enterprise bean references another bean.
Travel Stateful session, BMP entity, CMP entity Applet, ActiveX control Demonstrates client-side transactions. An enterprise bean uses a PAA as a data source. One enterprise bean references another bean.
VisualAge for Java demo CMP entity
Demonstrates client-initiated transactions, inheritance, association and polymorphic queries. One enterprise bean references another bean.
Big 3 Stateless session, CMP entity Multithreaded Demonstrates enterprise beans written to version 1.1 of the EJB specification. One enterprise bean references another bean.
Postcard Stateless session
Demonstrates enterprise beans that use Java Messaging Service (JMS) point-to-point messaging.
CORBA interoperability (policy wrapper) BMP entity
Demonstrates enterprise beans that communicate with C++ business objects (BO) and Java BOs (with a C++ client) that communicate with enterprise beans.
JDBC AA BMP entity
Demonstrates how to use the CB Session service. An enterprise bean uses PAA as a data source.