Java classes must be installed into a database before they can be used. You can install classes from Sybase Central or Interactive SQL.
Prerequisites
Complete the steps in Lesson 1 and 2 before attempting Lesson 3.
This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Using Java in the database.
Context and remarks
The database server uses the CLASSPATH environment variable to locate a file during the installation of classes. If the file listed in the INSTALL JAVA statement is located in a directory or ZIP file specified by the database server's CLASSPATH environmental variable, the server successfully locates the file and installs the class.
Check to see if the CLASSPATH environment variable is correctly set from the first lesson. It should include the directory containing the Invoice.class file.
CALL sa_split_list( xp_getenv( 'CLASSPATH' ), ';' ); |
Use Interactive SQL to execute a statement like the following. The path to the location of your compiled class file is not required if it can be located using the database server's CLASSPATH. The path, if specified, must be accessible to the database server.
INSTALL JAVA NEW FROM FILE 'path\\Invoice.class'; |
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |