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

SQL Anywhere 12.0.1 » SQL Anywhere Server - Programming » Java in the database


Creating a Java class for use with SQL Anywhere

The following sections describe the steps involved in creating Java methods and calling them from SQL. It shows you how to compile and install a Java class into the database to make it available for use in SQL Anywhere. It also shows you how to access the class and its members and methods from SQL statements.

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

Source code and batch files for the sample are provided in %SQLANYSAMP12%\SQLAnywhere\JavaInvoice.

The first step to using Java in the database is to write the Java code and compile it.

 Create the class file
  1. Go to the JavaInvoice folder containing the sample Java program.

  2. Compile the file to create the file Invoice.class.


    The class is now compiled and ready to be installed into the database.