Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Syntax 2: For instances of an EJB component – PB Docs 2019 – PowerBuilder Library

Syntax 2: For instances of an EJB component – PB Docs 2019

Syntax 2: For instances of an EJB component

Description

Allows a PowerBuilder client or component to obtain the home
interface of an EJB component in EAServer in order to create an instance
of the component.

Applies to

Connection objects, TransactionServer objects

Syntax

Argument

Description

objname

The name of the Connection object used to establish the
connection or of an instance of the TransactionServer context
object.

objectvariable

A global, instance, or local variable of the type of the
home interface to be created.

componentname

A string whose value is the name of the EJB component to
be created. You can optionally prepend a package name followed
by a slash to the component name (for example,
“mypackage/mycomponent”).

homeid

A string whose value is the name of the home interface
to be created. This argument is optional

Return value

Long.

Returns 0 if it succeeds and a negative number if an error
occurs.

Usage

EJBConnection

You can also use the Lookup method of the EJBConnection
PowerBuilder extension object to create an instance of an EJB
component running on any J2EE compliant application server. For more
information, see Lookup.

The Lookup function creates an instance of the home interface of
an EJB component so that you can use it to create an instance of the
EJB. Use the Connection object’s Lookup function to enable a
PowerBuilder client to access a component running in EAServer. You can
supply a server name or a list of server names in the location property
of the Connection object. Use the TransactionServer object’s Lookup
function to enable a PowerBuilder component running in EAServer to
access an EJB component running on the same server.

The Lookup function uses the standard CORBA naming service to
resolve componentname to a CORBA object that is then narrowed to the
home interface name of the component. If you do not specify the third
argument to the Lookup function, PowerBuilder expects the home interface
name to have the format PackageName/CompNameHome. However, most EJB
components use a standard Java package directory structure and the home
interface name has a format such as
com/domain/project/CompNameHome.

You can ensure that a PowerBuilder client or component can locate
the component’s home interface by supplying the third argument to the
Lookup function to specify the home interface name. A component’s home
interface name is defined in the com.sybase.jaguar.component.home.ids
property in the EAServer repository. The home.ids property has a format
like this:

The third argument should be the value of the component’s home.ids
string without the leading IDL: and trailing :1.0. For example:

Alternatively, you can use the fully-qualified Java class name of
the home interface specified in dot notation. For example:

Lookup is case sensitive

Lookup in EAServer is case sensitive. Make sure that the case in
the string you specify in the argument to the lookup function matches
the case in the ejb.home property.

Examples

The following example uses Lookup with the Connection object to
locate the home interface of the Multiply session EJB in the Java
package abc.xyz.math:

Entity beans have a findByPrimaryKey method that you can use to
find an EJB saved in the previous session. This example uses that method
to find a shopping cart saved for Dirk Dent:

Nonvisual objects deployed from PowerBuilder to EAServer can use
an instance of the TransactionServer context object to locate the home
interface of an EJB component in the same server:

See also

ConnectToServer
(obsolete)


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x