Java classes must be installed into a database before they can be used. You can install classes from Sybase Central or Interactive SQL.
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.
Contexte et remarques
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(CAST(xp_getenv('CLASSPATH') AS LONG VARCHAR), ';');
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';
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0|