Installs a JAR from a client file into an Adaptive Server. The utility is located in $SYBASE/OCS-12_5/bin.
In Windows NT, the utility is instjava.exe, located in %SYBASE%\OCS-12_5\bin.
installjava -f file_name [ -new | -update ] [ -j jar_name ] [ -S server_name ] [ -U user_name ] [ -P password ] [ -D database_name ] [ -I interfaces_file ] [ -a display_charset ] [ -J client_charset ] [ -z language ] [ -t timeout ] [-v]
Or
installjava -v
the name of the source file containing the classes to be installed in the database.
specifies whether the classes in the file already exist in the database.
If you specify the new parameter, you cannot install a class with the same name as an existing class.
If you specify the update parameter, you can install a class with the same name as an existing class, and the newly installed class replaces the existing class.
the name of the JAR containing the classes to be installed in the database. Indicates that the JAR file should be saved in the database and associated with the classes it contains.
the name of the server.
an Adaptive Server login name. If you omit the -U flag and parameter, or if you specify the -U flag with no parameter, Adaptive Server uses the current user’s operating system login name.
an Adaptive Server password. If you omit the -P flag and parameter, installjava prompts for a password. If you specify the -P flag with no password, the null password is used.
the name of the database in which to install the JAR. If you omit the -D flag, or if you specify the -D flag with no parameter, the user’s default database is used.
the name and location of the interfaces file to search when connecting to Adaptive Server. If you omit the -I flag and parameter, or if you specify the -I flag with no parameter, the interfaces file in the directory designated by your SYBASE environment variable is used.
allows you to use installjava from a machine where the character set differs that of the server. Use -a in conjunction with -J to specify the character set translation file (.xlt file) required for the conversion. Use -a without -J only if the client character set is the same as the default character set.
specifies the character set to use on the client. installjava uses a filter to convert input between client_charset and the Adaptive Server character set.
-J client_charset requests that Adaptive Server convert to and from client_charset, the character set used on the client.
-J with no argument disables character set conversion. Use this if the client and server use the same character set.
Omitting -J sets the character set to a default for the platform, which may not necessarily be the character set that the client is using. See the System Administration Guide for more information about character sets and associated flags.
the name of an alternate language for displaying installjava prompts and messages. Without the -z flag, installjava uses the server’s default language. You can add languages to an Adaptive Server during installation or afterward, using the langinstall utility or the sp_addlanguage stored procedure.
specifies the number of seconds before a SQL command times out. If you do not specify a timeout, the command runs indefinitely. This affects commands issued from within installjava, not the connection time. The default timeout for logging into installjava is 60 seconds.
prints the version number and copyright message for installjava and then exits.
Installs addr.jar and its classes, but does not retain the association between the JAR and classes:
installjava -f '/home/usera/jars/addr.jar' -new
In Windows NT:
instjava -f '\home\usera\jars\addr.jar' -new
Reinstalls addr.jar and associates its classes with the employees JAR name:
installjava -f '/home/usera/jars/addr.jar' -update -j employees
In Windows NT:
instjava -f '\home\usera\jars\addr.jar' -update -j employees
You must set the SYBASE environment variable to the location of the current version of Adaptive Server before you can use installjava.
Refer to Java in Adaptive Server Enterprise for more information about how this utility is used when Java is enabled in the database.
Any user can reference installed classes.
The parameter flags -f, -j, -S, -U, -P, -D, and -I can be written with or without a space between the flag letter and the following parameter.
If you use new with the -jar option and a JAR of that name already exists in the database, an exception is raised.
If any classes of the same name as those in the source JAR already exist in the database, an exception is raised.
WARNING! If you alter a class used as a column datatype by reinstalling a modified version of the class, you must make sure that the modified class can read and use existing objects (rows) in tables using that class as a datatype. Otherwise, you may be unable to access those objects without reinstalling the class.
If you use -update with the -jar option:
All classes in the database associated with the target JAR are deleted from the database and the classes in the source JAR file installed in their place.
If a class in the source JAR file is already installed in the database but is not attached to a JAR, the class in the source JAR is installed in the database and the unattached class is deleted.
If you use -update without the -jar option:
Classes in the source JAR file replace unattached classes of the same name.
Classes in the source JAR that do not correspond to an installed class are installed as unattached classes in the database.
If you install a new JAR with a replacement for an installed class that is referenced by a SQLJ procedure or function, make sure that the newly installed class has a valid signature for the SQLJ routine. If the signature is invalid, an exception is raised when the SQLJ routine is invoked.
When you execute installjava, an exclusive lock is placed on sysxtypes.
If -jar is specified, an exclusive table lock is placed on sysjars.
You need to be a System Administrator or Database Owner to use installjava.
sysjars, sysxtypes
Commands – remove java
System procedures – sp_helpjava
Utilities – extractjava