EJBConnection:
Lookup method
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 |
<span>connection</span>.Lookup (string <span>proxyname</span>, string <span>JNDIname</span>, string <span>homeinterfacename</span> ) |
Argument |
Description |
---|---|
connection |
The name of the EJBConnection object |
proxyname |
The name of the proxy object for the |
JNDIname |
The JNDI name of the EJB component |
homeinterfacename |
The fully-qualified class name of the |
Return Values
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 |
// Instance variable:<br>// EJBConnection myconnect<br>Multiply myMultiply<br>MultiplyHome myMultiplyHome<br>long ll_product<br> <br>TRY<br>   myMultiplyHome = myconnect.<span>lookup</span>("MultiplyHome", &<br>      "Math/Multiply", "com.xyz.math.MultiplyHome")<br>   myMultiply = myMultiplyHome.create()<br>   ll_product = myMultiply.multiply(1234, 4567)<br>catch (remoteexception re)<br>   messagebox("remoteexception", re.GetMessage())<br>catch (createexception ce)<br>   messagebox("createexception", ce.GetMessage())<br>CATCH (exception e)<br>   MessageBox("Exception", e.getmessage())<br>END TRY |
The style used for the JNDI name depends on the EJB server.