Contents Index Installing a JAR Special features of Java classes in the database

ASA Programming Guide
  Using Java in the Database
    Installing Java classes into a database

Updating classes and Jars


You can update classes and JAR files using Sybase Central or by entering an INSTALL JAVA statement in Interactive SQL or some other client application.

To update a class or JAR, you must have DBA authority and a newer version of the compiled class file or JAR file available in a file on disk.

When updated classes take effect 

Only new connections established after installing the class, or which use the class for the first time after installing the class, use the new definition. Once the Virtual Machine loads a class definition, it stays in memory until the connection closes.

If you have been using a Java class or objects based on a class in the current connection, you need to disconnect and reconnect to use the new class definition.

To understand why the updated classes take effect in this manner, you need to know a little about how the VM works. For information, see Configuring memory for Java.

To update a class or JAR (Sybase Central)

  1. Connect to a database with DBA authority.

  2. Open the Java Objects folder.

  3. Locate the class or JAR file you wish to update.

  4. Right-click the class or JAR file and choose Update from the popup menu.

  5. In the resulting dialog, specify the name and location of the class or JAR file to be updated. You can click Browse to search for it.

Tip 
You can also update a Java class or JAR file by clicking Update Now on the General tab of its property sheet.

To update a class or JAR (SQL)

  1. Connect to a database with DBA authority.

  2. Execute the following statement:

    INSTALL JAVA UPDATE
    [ JAR 'jarname' ]
    FROM FILE 'filename'

    If you are updating a JAR, you must enter the name by which the JAR is known in the database.

    For more information, see INSTALL JAVA statement.


Contents Index Installing a JAR Special features of Java classes in the database