Hi Ken -
Here's a sample client program.

Cheers
Ray


=========================================================================================
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import mypackage.MyEntityEJB;
import mypackage.MyEntityEJBHome;
import java.util.Collection;
import java.util.Iterator;

public class SampleMyEntityEJBClient 
{
  public static void main(String [] args)
  {
    SampleMyEntityEJBClient sampleMyEntityEJBClient = new SampleMyEntityEJBClient();
    try
    {
      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.rmi.RMIInitialContextFactory");
      env.put(Context.SECURITY_PRINCIPAL, "user");
      env.put(Context.SECURITY_CREDENTIALS, "password");
      env.put(Context.PROVIDER_URL, "ormi://<machine>/<application>");
      
      Context ctx = new InitialContext(env);
      MyEntityEJBHome myEntityEJBHome = (MyEntityEJBHome)ctx.lookup("MyEntityEJB");
      MyEntityEJB myEntityEJB;

      // Use one of the create() methods below to create a new instance
      for (int i=1; i<1000000; i++) {
          System.out.println(i);
          
          myEntityEJB = myEntityEJBHome.create( new Integer(i).toString() );
      }
  
    }
    catch(Throwable ex)
    {
      ex.printStackTrace();
    }

  }
}




--- Ken Cooper <[EMAIL PROTECTED]> wrote:

<HR>
<html><div style='background-color:'><DIV></DIV>
<DIV></DIV>
<P>The <A href="http://www.orionserver.com/tutorials/orion-primer";>The Orion 
Primer</A>&nbsp;uses
a servlet as a client for an EJB. Does someone have the code for a 'command line' 
client. That is,
a client that is a standard java app (public static void main...)? Have tried this but 
have had
'problems'.</P>
<P>Thanks - Ken<BR><BR>------------------------------------------------------ </P>
<DIV></DIV>Kenneth Cooper, Jr. [EMAIL PROTECTED] 
<DIV></DIV>------------------------------------------------------ 
<DIV></DIV></div><br clear=all><hr>Send and receive Hotmail on your mobile device: <a
href='http://g.msn.com/1HM305401/14'>Click Here</a><br></html>



__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

Reply via email to