SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)

Using SPJs in a Distributed Database Environment
For an SPJ to operate in a distributed database environment, the catalog in which the SPJ is created
must be visible on every remote node that requires access to that catalog. In other words, the
catalog of the SPJ must be visible on each node where you want users to be able to call the SPJ.
To make a catalog visible on a remote node, you must register the catalog on the remote node by
issuing a REGISTER CATALOG statement on a node where the catalog is visible, such as on the
local node. For the syntax of the REGISTER CATALOG statement, see the SQL/MX Reference
Manual. For information about how to manage a distributed database environment, see the SQL/MX
Installation and Management Guide.
In a distributed database environment, NonStop SQL/MX does not replicate or distribute the Java
class that underlies an SPJ. If you create an SPJ on a local node and want to call that SPJ on a
remote node, use one of these approaches:
Copying Java Classes to the Remote Node (page 98)
Specifying the Node in the External Path (page 99)
Make sure that the application classes on which the SPJ depends are also available in the distributed
database environment. For more information, see Distributing Application Classes (page 100).
Copying Java Classes to the Remote Node
Copy all the Java classes required for the SPJ from the local node (for example, \NODEA) to the
same OSS directory on the remote node (for example, \NODEB). By default, only a relative path
of the Java class is stored in the SQL/MX system metadata. Therefore, when an application on the
remote \NODEB calls the SPJ, the JVM looks for the Java class in the OSS directory on \NODEB.
See Figure 9.
Figure 9 Copying Java Classes to the Remote Node
98 Managing SPJs in NonStop SQL/MX