The SQLJ.INSTALL_JAR system procedure installs a JAR file in
GemFire XD.
Your jar file has two names:
- A physical name (the name you
gave it when you created it)
- A GemFire XD name (the GemFire XD
identifier that you give it when you load it into a particular schema). The
GemFire XD name, an SQL92 identifer, can be delimited and must be unique within
a schema.
A single schema can store more than one jar file.
For more information on when and how to use these procedures, see Storing and Loading JAR Files in GemFire XD.
To use the sqlj.install_jar procedure, the JAR file path must be
available on the specific GemFire XD data store to which the client is connected.
If the client connects directly to a known GemFire XD server, then only that
server requires the JAR file to be available at the specified path when the
procedure executes. However, if the client connects using a locator then it may
be connected to any available server in the distributed system. In this case,
the JAR file path should be available to
all members of the GemFire XD cluster (for example, from a
fileshare location such as
z:\) to ensure that the procedure can execute.
Note: If you cannot provide a common JAR location to ensure that the
sqlj.install_jar executes, use the
install-jar command instead. GemFire XD also provides an
alternate mechanism to inject your JAR file into the GemFire XD system from the
client itself. See
Installing a JAR File Directly into SYS.JARS.
Syntax
SQLJ.INSTALL_JAR(IN JAR_FILE_PATH VARCHAR(32672),
IN QUALIFIED_JAR_NAME VARCHAR(32672),
IN DEPLOY INTEGER)
- JAR_FILE_PATH
- The path and physical name of the JAR file to add. For example:
z:\todays_build\tours.jar
Use a file system path appropriate for the operating system (such
as
z:\filename.jar or
/opt/filename.jar). You cannot specify a HTTP
URL to use for loading the JAR file.
Note: The JAR file path must be available on the specific GemFire XD
data store to which the client is connected. If the client connects directly to
a known GemFire XD server, then only that server requires the JAR file to be
available at the specified path when the procedure executes. However, if a
client connects using a locator then they may be connected to any available
server in the distributed system. In this case, the JAR file path should be
available to all members of the GemFire XD cluster (for example, from a fileshare
location such as
z:\) to ensure that the procedure can
execute.
After installing the JAR file to one GemFire XD member, the JAR
is available to all other members in the distributed system, including members
that join the distributed system at a later time.
- QUALIFIED_JAR_NAME
- The GemFire XD name of the JAR file, qualified by a valid schema
name. Two examples are:
MYSCHEMA.Sample1
-- a delimited identifier
MYSCHEMA."Sample2"
You can use the JAR name in subsequent calls to
SQLJ.REPLACE_JAR
or
SQLJ.REMOVE_JAR.
- DEPLOY
- This integer argument is used to specify an alias for the JAR
file. However, GemFire XD ignores this argument, so it is normally set to 0.
Example
-- SQL statement
CALL SQLJ.INSTALL_JAR('tours.jar', 'APP.Sample1', 0)
-- SQL statement
-- using a quoted identifier for the
-- GemFire XD jar name
CALL SQLJ.INSTALL_JAR('tours.jar', 'APP."Sample2"', 0)