Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PL/SQL Debugging with Jdeveloper 10g

Status
Not open for further replies.

VacationLand

Technical User
Oct 21, 2005
2
US
I've been using the JDeveloper 10g tool for PL/SQL development lately and find that though Quest Software's TOAD allows PL/SQL debugging in an integrated development environment (IDE), Oracle's JDeveloper 10g PL/SQL debugger offers more features, starts faster, and is easier to use.

Much of the GUI should feel familiar to those who've utilized the TOAD debugger, yet architectural differences make PL/SQL debugging more rapid and robust in Oracle JDeveloper. For starters, Oracle Developer 10g initiates a new connection to the client via the DBMS_DEBUG_JDWP package and allows immediate debugging. Although both tools alter the code to debug PL/SQL, TOAD seems to take a while to reload the Procedure Editor with another copy of the code, especially if the source code has many lines.

On starting either TOAD 7.6 or JDeveloper 10g's debugger, a dialog box allows the user to easily select and debug any function or procedure that a package may contain. Both tools construct an anonymous PL/SQL block and allow for entry of initial values for input and output parameters. Only TOAD adds a COMMIT statement automatically with its anonymous PL/SQL block to run the code, while JDeveloper 10g generates DBMS_OUTPUT.PUT_LINE calls for every output parameter.

Both highlight source code line as one steps through the code. Both debuggers offer breakpoints and watches, which one must configure manually, however Oracle JDeveloper offers two additional views "Data" and "Smart Data" which clearly have greater ease of use than ordinary watches. When stepping through the code, these views update automatically to reflect any values that change. Furthermore these views update to show data that is in the current scope, i.e., when entering a new function, procedure, or trigger. With an easy to use interface, clicking on a plus sign in JDeveloper's Data and Smart Data panes reveals additional detail to the curious. For instance, with Smart Data and Data views, one can see inside nested tables with just a single click. TOAD has no comparable function aside from using watches.

Watching data values change with TOAD requires a more dedicated effort: one must type in the name of the quantity or expression to inspect the value under the watch window. If several values are of interest, this becomes impractical. JDeveloper implements persistent watches, meaning they reside in the watch pane for a project until the end-user removes them. That can be handy when evaluating code behavior in different schemas or instances. Unfortunately TOAD users have to set up watches anew for each debugging session. Inspecting data requires more effort in TOAD because all variable names have to be typed in, whereas JDeveloper lists all the variables and values automatically in a convenient browser pane. TOAD and JDeveloper users can undock, resize and relocate the pane where the programs values display, and both debuggers offer to display most values when the mouse pointer hovers over its name in the code.

In passing, both tools also integrate source code editors with context highlighting of keywords, comparison tools, highlighting of errors found during source code compilation, automatic database connection capabilities, and database navigators which allow data browsing. While TOAD has tried to integrate even the kitchen sink and be a do-it-all tool, I think that for PL/SQL development, JDeveloper integrates the essentials elegantly, and surpasses TOAD in the debugging arena.

Notes on JDeveloper Installation - JDeveloper 10g ( version 10 . 1 . 3 base) requires installation of a JRE 1.4.2 on your platform. Rather than installing into an existing Oracle Home, just unzip the file and configure the JRE and you're done. Online help can be accessed at an Oracle website.

The other requirement for getting off the ground with the PL/SQL debugger is having the appropriate privileges in your target schema. To use JDeveloper's PL/SQL debugger, you will need DEBUG CONNECT SESSION and DEBUG ANY PROCEDURE user privileges. Ask a DBA if you need assistance with user privileges.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top