Contents Index Create and compile the sample Java class Creating a SQL variable of type Invoice

ASA Programming Guide
  Introduction to Java in the Database
    Tutorial: A Java in the database exercise

Install the sample Java class


Java classes must be installed into a database before they can be used. You can install classes from Sybase Central or Interactive SQL. This section provides instructions for both. Choose whichever you prefer.

To install the class to the sample database ( Sybase Central )

  1. Start Sybase Central and connect to the sample database.

  2. Open the Java Objects folder and double-click Add Java Class. The Java Class Creation wizard appears.

  3. Use the Browse button to locate Invoice.class in the Samples\ASA\JavaInvoice subdirectory of your SQL Anywhere installation directory.

  4. Click Finish to exit the wizard.

To install the class to the sample database ( Interactive SQL )

  1. Start Interactive SQL and connect to the sample database.

  2. In the SQL Statements pane of Interactive SQL, type the following command:

    INSTALL JAVA NEW
    FROM FILE
    'path\\samples\\ASA\\JavaInvoice\\Invoice.class'

    where path is your SQL Anywhere directory.

The class is now installed into the sample database.

Notes 

For more information on installing classes, and for information on updating an installed class, see Installing Java classes into a database.


Contents Index Create and compile the sample Java class Creating a SQL variable of type Invoice