Attach to a Java VM

To attach to a Java VM from your user session:

  1. With the debugger running, connect to the sample database from isql as the sa:

    $SYBASE/bin/isql -Usa -P
    

    NoteYou cannot start Java execution from the debugger. To start a Java VM you must carry out a Java operation from another connection using the same user name.

  2. Execute Java code using the following statements:

    select JDBCExamples.serverMain(‘createtable’)
    select JDBCExamples.serverMain(‘insert’)
    select JDBCExamples.serverMain(‘select’)
    

    The Sybase Java VM starts in order to retrieve the Java objects from the table. The debugger immediately stops execution of the Java code.

    The debugger Connection window displays the Java VMs belonging to the user in this format:

    VM#: “login_name, spid:spid#
  3. In the debugger Connection window, click the Java VM you want and then click Attach to VM. The debugger attaches to the Java VM and the Source window appears. The Connection window disappears.

    Next, enable the Source window to show the source code for the method. The source code is available on disk.