Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Programming » Tutorial: Using Java in the Database » Installing Java classes into a database

Installing a JAR Next Page

Updating classes and JAR files


You can update classes and JAR files using Sybase Central or by executing an INSTALL JAVA statement from 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 that use the class for the first time after installing the class, use the new definition. Once the Java VM 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 update a class or JAR (Sybase Central)
  1. Connect to the database as a DBA user.

  2. Open the Java Objects folder.

  3. Locate the subfolder containing the class or JAR file you want to update.

  4. Select the class or JAR file and the choose File > Update.

    The Update dialog appears.

  5. In the Update 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 as a DBA user.

  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. See INSTALL JAVA statement.