Before you can work with the Java debugger, you need to configure Toad to work with Oracle's Java Debugger.
To prepare to debug Java code:
- Be sure you are running Oracle 9.2 or higher.
- Confirm that the debug package DBMS_DEBUG_JDWP is present and in a valid state.
If it is not, then:
1. Logon as SYS
2. Run the dbmsjdwp.sql and pvrtjdwp.plb scripts, located in the $ORACLE_HOME/rdbms/admin directory.
When that is set, set the Toad options
1. In Toad, select View | Toad Options, and in the left side, click Editor|Debug.
2. Select Use JDWP debugger for Oracle 9.2+.
3. Include configuration information as described below:
- Host This must be an IP address (of any machine that has the Oracle client 9.2 or above installed)
or the name of your local machine. It will function as the debugger host during a debugging session.
- Port Choose a TCP port for the Toad Debugger to listen to. Leave this value as Use any available to
make Toad pick one for you.
- Allow stepping into Java Source - On some platforms stepping into Java code may cause the debugger to
hang. This check box was introduced to prevent this from occurring. Uncheck this check box if you are
experiencing such problem to continue debugging your PL/SQL code.
- Enable DBMS_JAVA - By default, System.out.* java calls do not display locally. In order to redirect this output
to the DBMS_OUT, a call to DBMS_JAVA must be used with the appropriate buffer size. Check this
option if you desire to send System.out.* java calls to the DBMS Output window.
For more about JDWP debugger please refer to the Help files in Toad ("JDWP", "debug").