What the EJB Bank Account sample does

The sample application extracts customer information from data tables and returns it to the user. The sample consists of:
The sample works like this:
  1. The user starts the application from a Web browser. A form is displayed.
  2. The form requests a customer number from the user. When the user has entered a customer number and pressed the SUBMIT button, the servlet is invoked.
  3. The servlet:
    1. Looks up a reference to the enterprise bean in the JNDI namespace
    2. Creates a new remote instance of the enterprise bean in CICS
    3. Invokes a method on the bean-instance, passing as input the customer number input by the user
  4. The enterprise bean uses the Common Connector Interface (CCI) of the CCI Connector for CICS® TS to link to the CICS COBOL server programs, passing the customer number.

    The CCI Connector for CICS TS is described in The CCI Connector for CICS TS.

  5. The server programs use the specified number as the key to the DB2 records for this customer. They retrieve the customer's details from the DB2 data tables and return the account number, balance, and address to the enterprise bean.
  6. The enterprise bean returns the customer's details to the servlet, which uses a JavaServer Page to display them on the user's browser. If the customer number is not valid, the browser displays an error page.
Design note: An alternative design would be to replace the connector code with a JCICS LINK call. The advantage of using a CCI-compliant connector such as the CCI Connector for CICS TS is that it makes it easier to port the application between application servers such as WebSphere and CICS. If portability is not required, a JCICS call would be sufficient.

Figure 1 shows the components of the sample application.

Figure 1. Overview of the EJB Bank Account sample application. The main elements of the sample are a Java servlet, an enterprise bean, two CICS server programs, and two DB2 data tables. The sample extracts customer details from the data tables and returns them to the user. In this example, the servlet is running in a Web application server on a Windows NT server; an LDAP name server is used. Other configurations are possible. For example, a COS Naming Server could have been used.
The picture shows a workstation, a Windows NT server, and a z/OS operating system. On the workstation, a Web browser is running. On Windows NT, there are a Web server and a Web application server, on which a Java servlet is running. On z/OS, there are an LDAP name server and a CICS EJB server, on which an enterprise bean instance is running. The enterprise bean uses the CCI Connector for CICS TS to communicate with two CICS COBOL programs, which access a DB2 database.The workstation user uses the Web browser to start the Java servlet on Windows NT. The Java servlet finds the home interface of the enterprise bean by means of a JNDI call to the LDAP name server, then starts an instance of the bean in CICS, passing the bean the user's input. Depending on what information the user has requested, the enterprise bean uses the connector to run one or other of the COBOL programs. The COBOL program retrieves the requested information from DB2 and returns it to the bean. The bean returns it to the servlet, which uses a JavaServer Page to display it on the user's browser.