Preparing for the JDBC Examples

The code fragments in the following sections are taken from the complete class in %ALLUSERSPROFILE%\SybaseIQ\samples\SQLAnywhere\JDBC\JDBCExample.java. In preparation for these sections, the sample Java application is compiled and installed into the database.

Prerequisites

You must have the MANAGE ANY EXTERNAL OBJECT system privilege.

A Java Development Kit (JDK) must be installed.

Task
  1. Compile the JDBCExample.java source code.
  2. Connect to the database from Interactive SQL.
  3. Install the JDBCExample.class file into the sample database by executing the following statement in Interactive SQL:
    INSTALL JAVA NEW
    FROM FILE 'JDBCExample.class';

    If the database server was not started from the same directory as the class file and the path to the class file is not listed in the database server's CLASSPATH, then you will have to include the path to the class file in the INSTALL statement.

The JDBCExample class file is installed in the database and ready for demonstration.