Contents Index Introduction Managing the runtime environment for Java

ASA Programming Guide
  Using Java in the Database
    Introduction

Setting up the Java sample


Some of the examples in this chapter require you to add the JDBCExamples class to the sample database.

Setting up the Java examples involves two steps:

  1. Java-enable the sample database. Adaptive Server Anywhere databases are not Java-enabled by default.

  2. Add the JDBCExamples class to the database.

To Java-enable the sample database

  1. Start Sybase Central and connect to the sample database (ASA 9.0 Sample ODBC data source). An asademo9 database server appears with an asademo database.

  2. In the left pane of Sybase Central, right click the asademo database and choose Upgrade Database from the popup menu. The Upgrade a Database wizard appears.

  3. Follow the instructions in the Upgrade a Database wizard. Choose the option to Install Java Support with a JDK version of 1.3.

  4. Restart the sample database.

    When the Upgrade a Database wizard has completed, disconnect and ensure that the sample database is shut down. The database must be shut down and restarted before Java support can be used.

  5. Confirm that Java support has been added:

To add the JDBCExamples class to the sample database

  1. Start Sybase Central and connect to the sample database (ASA 9.0 Sample ODBC data source). An asademo9 database server appears with an asademo database.

  2. In the left pane of Sybase Central, open the Java Objects folder.

  3. Right-click the right pane and choose New > Java Class from the popup menu. The Create a New Java Class wizard appears.

  4. Click Browse and locate JDBCExamples.class in the Samples\ASA\Java subdirectory of your SQL Anywhere installation.

  5. Click OK and click Finish to complete the installation.


Contents Index Introduction Managing the runtime environment for Java