The first step to using Java in the database is to write the Java code and compile it.
Prérequis
Install a Java Development Kit (JDK), including the Java compiler (javac) and a Java Runtime Environment (JRE).
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.
Open a command prompt and go to the %SQLANYSAMP16%\SQLAnywhere\JavaInvoice folder.
cd %SQLANYSAMP16%\SQLAnywhere\JavaInvoice |
Compile the Java source code example using the following command:
javac Invoice.java |
This step is optional. Before starting the database server, make sure that the location of your compiled class file is included in the CLASSPATH environment variable. It is the CLASSPATH of the database server that is used, not the CLASSPATH of the client running Interactive SQL. Here is an example:
SET CLASSPATH=%SQLANYSAMP16%\SQLAnywhere\JavaInvoice |
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |