    All Examples  All EJB Examples  This Package

## Class examples.ejb.extensions.finderEnumeration.Client

    java.lang.Object
        |
        +----examples.ejb.extensions.finderEnumeration.Client

public class Client
extends java.lang.Object

This class demonstrates calling an entity EJBean, followed by two exercises:

Part A: Deposit and attempt to withdraw more than the current account balance. An application-specific exception should be thrown.

Part B: Create some new accounts, with different initial balances. Find all the accounts with a balance greater than a specific value. When finished, the new accounts are removed.

This class also illustrates how to lookup an EJB home in the JNDI tree.

##

Client(String, String, String)

##

main(String[])
  Runs this example from the command line.
runExamplePartA()
  Executes Part A of this example.
runExamplePartB()
  Executes Part B of this example.

##

Client

    public Client(java.lang.String url,
                  java.lang.String user,
                  java.lang.String password)

##

main

    public static void main(java.lang.String args[])

Runs this example from the command line. Example:

`java examples.ejb.basic.beanManaged.Client "t3://localhost:7001" scott tiger`

The parameters are optional, but if any are supplied, they are interpreted in this order:

  Parameters:
    `url` - URL such as "t3://localhost:7001" of Server
    `user` - User name, default null
    `password` - User password, default null

runExamplePartA

    public void runExamplePartA()

Executes Part A of this example. Part A: Find some accounts using a normal finder method and then call a business method on each.

runExamplePartB

    public void runExamplePartB()

Executes Part B of this example. Part B: Find some accounts using a finder that uses FinderEnumeration to prime the EJB cache with its results and call a business method on each bean.

    All Examples  All EJB Examples  This Package