DB2 Universal Database and the .NET Developer - Information and Other Goodies
When it comes to development environments, drivers, and APIs - being up-to-date is critical to optimal performance. To ensure that you have access to a rich continuum of tools, I recommend that .NET developers have their clients and databases at the DB2 UDB Version 8.2.2 level, which lets you use concurrent data readers to access more than one result set in the same database connection and query both of those result sets concurrently. You need to host a DB2 UDB environment at the V8.2 level or later to take advantage of many of the features I have outlined in this series.
So what is an easy way to keep your development systems up-to-date? The DB2 UDB add-in for Visual Studio .NET includes an option from the Help menu that lets you check the Web for DB2 UDB updates, as shown below:
This option launches an updater service that not only informs you of updates available for download, but also acts as a news feeder for DB2 UDB-related information.
Debugging Your Routines
The DB2 UDB add-in for Visual Studio includes integrated debugging of stored procedures. While IBM has its own distributed debugger, the Visual Studio .NET debugger has been extended to support the backend DB2 SQL debugger. This allows you to use the Visual Studio.NET debugger to step through your code, set line or variable breakpoints, view variable values (including SQLSTATE and SQLCODE), change variable values, view call stack information for nested procedures, and switch between different procedures on the call stack. This affords developers a powerful debugging environment that they are accustomed to for their DB2 UDB business logic.
An example of this integrated debugger is shown below:
The DB2 UDB SQL Editor
The DB2 UDB add-in comes with a DB2 SQL editor that understands the DB2 UDB SQL API. If you have read any other of the articles in this series, you have seen this feature utilized in other features like the DB2 Create View wizard and the DB2 Create SQL Procedure wizard. The DB2 SQL editor is composed of extensions to the native Visual Studio .NET editor with customizations for DB2 UDB.
The DB2 SQL editor provides support for syntax highlighting, which is basically colorized SQL. It also supports DB2 SQL statement completion via .NET Intellisense; the object names lookup uses schemas followed by a dot, the column names lookup uses tables or views followed by a dot, and the parameter list lookup uses procedures or functions followed by an open bracket.
The DB2 SQL editor is shown below:
In addition to this, you can create code fragments that are collapsible and expandable, as shown in the following figure:
There are a number of other scripting options, some of which are shown in the preceding figure.
The DB2 UDB Output Message Pane
To help developers quickly diagnose build failures that are due to database-specific issues, IBM has also included an output message pane solely designed for DB2 UDB database message reporting:
Wrapping it all up
In this part of the series, I took you through a number of features that help speed up application development. You have seen easier ways to start instances, get DB2 UDB help, identify database errors, troubleshoot your routines, debug, and more.
Are you ready to try it out for yourself? Get a free trial copy of a DB2 UDB for Windows server at: www.ibm.com/software/data/db2/udb/support/downloadv8.html. You can also get a free copy of DB2 UDB Personal Edition for development purposes at: www.software.ibm.com/webapp/download/search.jsp?go=y&rs=db2udbpde.
About the Author
Paul C. Zikopoulos, BA, MBA, is an award-winning writer and speaker with the IBM Database Competitive Technologies team. He has more than nine years of experience with DB2 products and has written numerous magazine articles and books about it. Paul has co-authored the books: DB2 Version 8: The Official Guide, DB2: The Complete Reference, DB2 Fundamentals Certification for Dummies, DB2 for Dummies, and A DBA's Guide to Databases on Linux. Paul is a DB2 Certified Advanced Technical Expert (DRDA and Cluster/EEE) and a DB2 Certified Solutions Expert (Business Intelligence and Database Administration). Currently he is writing a book on the Apache Derby/IBM Derby database. You can reach him at: email@example.com.
IBM, DB2, DB2 Universal Database, and developerWorks are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.
Intel is a trademark or registered trademark of Intel Corporation in the United States and other countries.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Linux is a trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks of others.
© Copyright International Business Machines Corporation, 2005. All rights reserved.
The opinions, solutions, and advice in this article are from the author's experiences and are not intended to represent official communication from IBM or an endorsement of any products listed within. Neither the author nor IBM is liable for any of the contents in this article. The accuracy of the information in this article is based on the author's knowledge at the time of writing.
Page 2 of 2