Contents Index Creating a class Installing a JAR

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

Installing a class


To make your Java class available within the database, you install the class into the database either from Sybase Central, or using the INSTALL JAVA statement from Interactive SQL or other application. You must know the path and file name of the class you wish to install.

You require DBA authority to install a class.

To install a class (Sybase Central)

  1. Connect to a database with DBA authority.

  2. Open the Java Objects folder for the database.

  3. Right-click in the right pane and choose New > Java Class from the popup menu.

  4. Follow the instructions in the wizard.

To install a class (SQL)

  1. Connect to a database with DBA authority.

  2. Execute the following statement:

    INSTALL JAVA NEW
    FROM FILE 'path\\ClassName.class'

    where path is the directory where the class file is, and ClassName.class is the name of the class file.

    The double backslash ensures that the backslash is not treated as an escape character.

    For example, to install a class in a file named Utility.class, held in the directory c:\source, you would enter the following statement:

    INSTALL JAVA NEW
    FROM FILE 'c:\\source\\Utility.class'

    If you use a relative path, it must be relative to the current working directory of the database server.

    For more information, see INSTALL JAVA statement.


Contents Index Creating a class Installing a JAR