# SQLJ.INSTALL_JAR system procedure

The `SQLJ.INSTALL_JAR` system procedure stores a jar file in a database.

## Syntax

    SQLJ.INSTALL_JAR(IN JAR_FILE_PATH_OR_URL VARCHAR(32672),
                     IN QUALIFIED_JAR_NAME VARCHAR(32672),
                     IN DEPLOY INTEGER)

JAR_FILE_PATH_OR_URL
  The path or URL of the jar file to add. A path includes both the directory and the file name (unless the file is in the current directory, in which case the directory is optional). Two examples:

      d:/todays_build/tours.jar

      http://www.example.com/tours.jar

QUALIFIED_JAR_NAME
  The Derby name of the jar file, qualified by the schema name. Two examples:

      MYSCHEMA.Sample1

       -- a delimited identifier
      MYSCHEMA."Sample2"

DEPLOY
  If set to 1, indicates the existence of an SQLJ deployment descriptor file. Derby ignores this argument, so it is normally set to 0.

## Execute privileges

If authentication and SQL authorization are both enabled, only the database owner has execute privileges on this procedure by default. See "Configuring user authentication" and "Configuring user authorization" in the Derby Security Guide for more information.

The database owner can grant access to other users. Since this procedure can be used to install arbitrary code (possibly from across the network) that runs in the same Java Virtual Machine as the Derby database engine, the execute privilege should be granted only to trusted users.

## SQL examples

    -- SQL statement
    -- install jar from current directory
    CALL SQLJ.INSTALL_JAR('tours.jar', 'APP.Sample1', 0)

    -- SQL statement
    -- install jar using full path
    CALL SQLJ.INSTALL_JAR('c:\myjarfiles\tours.jar', 'APP.Sample1', 0)

    -- SQL statement
    -- install jar from remote location
    CALL SQLJ.INSTALL_JAR('http://www.example.com/tours.jar', 'APP.Sample2', 0)

    -- SQL statement
    -- install jar using a quoted identifier for the
    -- Derby jar name
    CALL SQLJ.INSTALL_JAR('tours.jar', 'APP."Sample3"', 0)

Parent topic: System procedures for storing jar files in a database
Related reference
SQLJ.REMOVE_JAR system procedure
SQLJ.REPLACE_JAR system procedure