REPLACE JAR (Re-register JAR file)

Function

REPLACE JAR re-registers a JAR file at the HiRDB server. The file is re-registered in the JAR file storage directory associated with the authorization identifier that is connected.

Format

REPLACE JAR{:embedded-variable|'character-string'}

Operands

Specifies as an absolute or relative path name a name for the JAR file that is to be re-registered.

:embedded-variable
Specifies a VARCHAR-type embedded variable that contains the name that is to be re-registered as its value.
Character sets other than the default character set cannot be specified.
'character-string'
Specifies as a character string literal a name for the JAR file that is to be re-registered.

Common rules

  1. You must be connected to the HiRDB server to execute REPLACE JAR.
  2. Any error code is returned to SQLCODE.
  3. A JAR file at a different server machine cannot be specified.
  4. Wildcards cannot be used.
  5. If a JAR file with the specified name is already registered, an error results; the existing file is not overwritten.
  6. REPLACE JAR should be executed before any transaction is started.

Example

Re-register a JAR file named c:\work\sampleproc.jar by setting its name in an embedded variable:

EXEC SQL BEGIN DECLARE SECTION ;
struct {
   short  len ;
   char   str[256] ;
} filename ;
EXEC SQL END DECLARE SECTION ;
EXEC SQL CONNECT ;
strcpy(filename.str,"c:\work\sampleproc.jar") ;
filename.len = strlen(filename.str) ;
EXEC SQL REPLACE JAR :filename ;