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

SQL Anywhere 11.0.0 » SQL Anywhere Server - Programming » Java in the database » Tutorial: Using Java in the database


Introduction to Java in the database tutorial

This chapter describes how to accomplish tasks using Java in the database. The first thing you need to do is compile and install Java classes in a database to make them available for use in SQL Anywhere.

The following is a brief introduction to the steps involved in creating Java methods and calling them from SQL. It describes how to compile and install a Java class into the database. It also describes how to access the class and its members and methods from SQL statements.


The tutorial assumes that you have a Java Development Kit (JDK) installed, including the Java compiler (javac) and Java VM.


Source code and batch files for this sample are provided in samples-dir\SQLAnywhere\JavaInvoice.

Creating and compiling the sample Java class
Choosing a Java VM
Install the sample Java class
Using the CLASSPATH variable
Accessing methods in the Java class
Accessing fields and methods of the Java object