Lookup
Description
Allows a PowerBuilder client to obtain the home interface of an
EJB component in an application server in order to create an instance of
the component.
Syntax
|
1 |
connection.Lookup (string proxyname, string JNDIname, string homeinterfacename ) |
|
Argument |
Description |
|---|---|
|
connection |
The name of the EJBConnection object used to |
|
proxyname |
The name of the proxy object for the EJB |
|
JNDIname |
The JNDI name of the EJB component |
|
homeinterfacename |
The fully-qualified class name of the EJB home |
Return value
Powerobject. A proxy object for the home interface of the
EJB.
Throws
NamingException
Examples
The following example uses lookup to locate the home interface of
the Multiply session EJB in the Java package com.xyz.math. The example
assumes the connection to the EJB server has already been
established:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// Instance variable: // EJBConnection myconnect Multiply myMultiply MultiplyHome myMultiplyHome long ll_product TRY myMultiplyHome = myconnect.lookup("MultiplyHome", & "Math/Multiply", "com.xyz.math.MultiplyHome") myMultiply = myMultiplyHome.create() ll_product = myMultiply.multiply(1234, 4567) catch (remoteexception re) messagebox("remoteexception", re.GetMessage()) catch (createexception ce) messagebox("createexception", ce.GetMessage()) CATCH (exception e) MessageBox("Exception", e.getmessage()) END TRY |
The style used for the JNDI name depends on the EJB server.
See also