CreateJavaInstance – PB Docs 126

JavaVM:

CreateJavaInstance method

Description

Creates an instance of a Java object from a proxy name.

Syntax

Argument

Description

javavm

An instance of the JavaVM class.

proxyobject

PowerObject into which the function places
a reference to the object specified by proxyname. This argument
is passed by reference.

proxyname

The name of the proxy object for the
local Java class.

Return Values

Long. Returns 0 for success and one of
the following values for failure:

  • -1

    Failed to create Java class.

  • -2

    Invalid proxy name.

  • -3

    Failed to create proxy object.

Examples

In this example, the create method
accepts a Java Integer class argument. PowerBuilder
creates a proxy called java_integer (the
prefix java_ is required to prevent
a conflict with the PowerBuilder integer type).
The call to CreateJavaInstance sets the value
of that variable so you can call the EJB create method:

Usage

Use this method when an EJB method accepts a Java class as
an argument. For example, if the primary key class argument to the findByPrimaryKey method
is a Java class, use the CreateJavaInstance method
to create the primary key class. You then use a PowerBuilder proxy
to communicate with the Java class.


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