Manage JAR Files in SQLFire

When you install a JAR file, you specify a unique SQLFire JAR name, which is a SQL92Identifier. SQLFire installs the JAR file and automatically loads the JAR file classes into its class loader, and it becomes available to all members of the distributed system (including members that join the system at a later time).

SQLFire provides sqlf commands to install, replace, and remove JAR files as described in these sections:

Installing a JAR File

To install a JAR file to a SQLFire distributed, use the sqlf install-jar command. For example, the following command installs the tours.jar file to the APP schema:
sqlf install-jar -name=APP.toursjar -file=c:\tours.jar 
If the SQLFire distributed system uses multicast for discovery instead of a locator, specify the multicast properties instead, as in:
sqlf install-jar -name=toursjar -file=c:\tours.jar 

The -name that you provide for the JAR must be a unique identifier. You must include a schema name to qualify the identifier. You can use the identifier with later calls to sqlf replace-jar or sqlf remove-jar.

The -file option specifies the location of the JAR file to install using either a local path or a URL.

After installing the JAR to the distributed system, SQLFire automatically loads the JAR file classes into its class loader; you do not need to explicitly load classes after installing the JAR. The JAR and its classes are available to all members of the SQLFire distributed system, including those that later join the cluster.

Note: After you install a JAR file, you cannot modify any of the individual classes or resources within the JAR file. Instead, you must replace the entire JAR file to update a class.

Replacing a JAR File

Use the sqlf replace-jar command to replace an installed JAR file with a new JAR. Specify the identifier of an existing JAR installation when using the command, as in:
sqlf replace-jar -name=APP.toursjar -file=c:\tours2.jar 

When you replace a JAR file, SQLFire loads the new classes right away without your having to reboot.

Removing an Installed JAR File

Specify the JAR identifier with the sqlf remove-jar command to remove an installed JAR file. For example, the following command removes the class files associated with the APP.toursjar JAR installation:
sqlf remove-jar -name=APP.toursjar