Contents Index Prepare the database Set a breakpoint

ASA SQL User's Guide
  Debugging Logic in the Database
    Tutorial: Getting started with the debugger
      Lesson 3: Debug a Java class

Display Java source code in the debugger

The debugger looks in a set of locations for source code files (with .java extension). You need to add the Samples\ASA\Java subdirectory of your installation directory to the list of locations, so that the code for the class currently being executed in the database is available to the debugger.

To display Java source code in the debugger

  1. Start Sybase Central and connect to the sample database (ASA 9.0 Sample ODBC data source).

  2. Choose the Sybase Central Debug task.

    Choose Task > Debug.

  3. Set the locations in which to look for Java source code.

    1. From the Debug menu, choose Set Java Source Path. The Java Source Path window appears.

    2. Click Browse Folder. Navigate to the folder where your Java source code (.java files) is stored. To view the source code for the JDBCExamples class, browse to the Samples\ASA\Java subdirectory of your SQL Anywhere installation. If you installed SQL Anywhere in the default installation directory, you would navigate to the following directory:

      C:\Program Files\Sybase\SQL Anywhere 9\Samples\ASA\Java
  4. Display the source code for the JDBCExamples class:

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

    2. In the right pane, open the All Java Classes folder and locate the JAR file or class you wish to debug. Depending on your Sybase Central settings, you may wish to click the Creator column. This sorts the listing by creator so that classes owned by DBA appear before those owned by SYS.

    3. Double-click the JDBCExamples class.

    4. In the right pane, click the Source tab. The source code for the class is displayed.


Contents Index Prepare the database Set a breakpoint