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

SQL Anywhere 11.0.1 » SQL Anywhere Server - Programming » Java in the database » Java support in SQL Anywhere

 

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. In the left pane, expand the External Environments folder.

  3. Click Java.

  4. Choose File » New » Java Class.

  5. Click Browse and browse to the location of Invoice.class.

  6. Click Finish.

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 statement:

    INSTALL JAVA NEW 
    FROM FILE 'path\\Invoice.class';

    Here path is the location of your compiled class file.

  3. Press F5 to execute the statement.

The class is now installed into the sample database.

Notes
  • At this point, no Java in the database operations have taken place. The class has been installed into the database and is ready for use.

  • Changes made to the class file from now on are not automatically reflected in the copy of the class in the database. You must update the classes in the database if you want the changes reflected.

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