Stepping through source code

Following the previous section, the debugger should have stopped executing JDBCExamples.Query() at the first statement in the method:

Examples

Here are some steps you can try:

  1. Step to the next line Choose Debug > Step Over, or press F10 to step to the next line in the current method. Try this two or three times.

  2. Run to a selected line Click at the end of the following line using the mouse, and choose Debug > Run To Cursor, or press CTRL + F10 to run to that line and break:

    max_price = price;
    

    The red arrow moves to the line.

  3. Set a breakpoint and execute to it Select the following line (line 292) and press F9 to set a breakpoint on that line:

    return max_price;
    

    An asterisk appears in the left column to mark the breakpoint. Press F5 to execute to that breakpoint.

  4. Experiment Try different methods of stepping through the code. End with F5 to complete the execution.

    When you have completed the execution, the Interactive SQL data window displays the value 24.

  5. Proceed to the next breakpoint To move to the next breakpoint, add an F5.

    When you have completed the execution, the Interactive SQL data window displays the value 24.

The complete set of options for stepping through source code appear on the Run menu. You can find more information in the debugger online Help.