All Examples All EJB Examples This Package
java.lang.Object | +----examples.ejb.basic.containerManaged.Client
Part A: Create an Account and Deposit some money into it. Next attempt to withdraw more than the current account balance. An application-specific exception should be thrown. Finally, remove the account.
Part B: Create some new accounts, with different initial balances. Find all the accounts with a balance greater than a specific value. Find the account with a balance of zero. Attempt to find accounts with a null balance. Finally, remove all newly created accounts.
This class also illustrates how to lookup an EJB home in the JNDI tree.
public Client(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String accountId) throws javax.naming.NamingException
public static void main(java.lang.String args[])
java examples.ejb.basic.containerManaged.Client "t3://localhost:7001" scott tiger 10020
The parameters are optional, but if any are supplied, they are interpreted in this order:
url
- URL such as "t3://localhost:7001" of Server
user
- User name, default null
password
- User password, default null
accountID
- String Account ID to test, default "10020"
public void runExamplePartA()
public void runExamplePartB() throws javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.FinderException, javax.ejb.RemoveException
All Examples All EJB Examples This Package