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 » Introduction to Java in the Database tutorial

Choosing a Java VM Next Page

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.

To install the class to the SQL Anywhere sample database (Sybase Central)
  1. Start Sybase Central and connect to the sample database.

  2. Open the Java Objects folder and then choose File > New > Java Class.

    The Create Java Class wizard appears.

  3. Use the Browse button to locate Invoice.class.

  4. Click Finish to close the wizard.

To install the class to the SQL Anywhere 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\\Invoice.class';

    Here path is the location of your compiled class file. The class is now installed into the sample database.

  3. Press F5 to execute the statement.

Notes

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