samples.j2ee.ejb.sequence.jdbc
Class Client

java.lang.Object
  |
  +--samples.j2ee.ejb.sequence.jdbc.Client

public class Client
extends java.lang.Object

This class demonstrates calling an entity EJBean, followed by creating two new accounts with an opening balance and an automatically generated primary key.

This class also illustrates how to search the JNDI tree for an appropriate container.


Constructor Summary
Client()
           
 
Method Summary
static void main(java.lang.String[] args)
          Runs this example from the command line.
static javax.naming.Context newInitialContext()
          Gets an initial context for the current user, password and url.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Client

public Client()
Method Detail

main

public static void main(java.lang.String[] args)
Runs this example from the command line. Example:

java samples.j2ee.ejb.sequence.jdbc.Client "corbaloc://localhost:7001" scott tiger

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

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

newInitialContext

public static javax.naming.Context newInitialContext()
                                              throws java.lang.Exception
Gets an initial context for the current user, password and url.
Returns:
Context
Throws:
java.lang.Exception - if there is an error in getting the Context