Add-in features for Visual Studio .NET - IBM DB2

The IBM DB2 Development Add-In integrates a collection of DB2 specific features with the Microsoft Visual Studio .NET development environment. Visual Studio .NET 2005 Add-In is available as a separate install from the core DB2 product. This was done to allow the tool to be available with other IBM databases. The minimum requirement for the Visual Studio .NET 2005 Add-In is the DB2 Application Development Client V8.2 Fix Pack 10 or later.The main features of IBM DB2 Development Add-In for V8 are:

  • Launch various DB2 development and administration tools.
  • Access and manage DB2 data connections in the IBM Explorer.
  • Create and manage DB2 projects in the Solution Explorer.
  • Create and modify DB2 scripts to create stored procedures and user defined functions (UDFs).

In Visual Studio 2005 Add-In, the following features are available in addition to the previous V8 IBM DB2 Development Add-In:

  • Seamless integration with Microsoft Server Explorer, where DB2 connections can now be added into Microsoft Server Explorer (in V9, IBM Explorer has been deprecated).
  • Introduction of IBM Designer to script and create DB2 database objects.
  • IBM Database Add-Ins for Visual Studio 2005 is now available as a separate install.
  • You can build Windows applications and Web sites for DB2 without writing any code:
  • – All flavors of DB2 are supported (DB2 UDB for Linux, UNIX, and Windows, DB2 UDB for iSeries, and DB2 UDB for z/OS).
    – Federated database and nicknames are supported for application development.
    – Filtering of database objects is supported for optimal performance on iSeries and zSeries® servers.
    – Caching of schema information for objects in DB2 connections in Server Explorer provides better application development performance at design time.
  • A new feature in IBM tooling is the ability to hide or show specific folders for a DB2 connection in Server Explorer.
  • The tooling continues to support displaying detailed messages of DB2 activity on the IBM Message Pane.
  • The new tooling introduces a new set of IBM designers to create, alter, and clone database objects:
  • – All IBM designers continue to use the smart multi-line editors that provide syntax colorization and statement completion.
    – You have the ability to create new tables, views, and procedures using IBM designers.
    – There is new functionality to alter existing tables, views, and procedures, using IBM designers.
    – There is new functionality to create and alter roles and assign privileges to database objects.
    – The IBM designers give you the ability to clone tables and procedures.
  • The new tools give you a new way to seamlessly debug SQL procedures on Linux, UNIX, and Windows, or zSeries servers, from Server Explorer. Debugging support now uses the new IBM Designer for Procedures thatallows a seamless debugging experience.
  • There is a new designer to view or create script for all objects. The IBM Script Designer provides:
  • – The ability to change and execute scripts.
    – The ability to run single or multiple DDL/DML statements and view results in single or multiple grids.
    – The ability to alter objects using scripts.
  • You can show data from tables and views with the following new enhancements:
  • – You can filter columns while retrieving data.
    – You can save data as XML to import or export, allowing easy table or view data migration.
  • Execute procedures and functions has the following new enhancements:
  • – You have the ability to run pre- and post-scripts.
    – You can save input or in-out parameter values across Visual Studio sessions.
    – You can commit or roll back transactions.
  • There is a new user interface to view result sets in DB2 connections on the Server Explorer. It gives you:
  • – The ability to view single or multiple result sets for a procedure in Server Explorer.
    – The ability to discover automatically (when possible) or to manually define or customize result set definitions for a procedure.
    – The ability to set the preference to always discover or always manually define the result set definition in Add or Modify connection.
  • You have continued support for DB2 projects and IBM Scripting wizards to create DB2 scripts. The debugging support has been discontinued from DB2 Projects. Instead, it is supported seamlessly from DB2 connections on Server Explorer.

Visual Studio 2005 Add-In: Sever Explorer integration
DB2 connections can be added from Server Explorer using the Add Connection option.

  1. Open Server Explorer if it is not already open using View Server Explorer.
  2. In the Server Explorer, right-click and select Add Connection from Data Connections node as shown below
  3. Adding connection in Data Explorer

    Adding connection in Data Explorer

  4. Select Data source then select IBM DB2 as shown below. Click Continue.
  5. Selecting IBM DB2 in Data Explorer

    Selecting IBM DB2 in Data Explorer

  6. Add the server name (given drop-down box will show server options), database name, user ID, and password as shown below Click OK, which will now add the given database connection to Server
  7. Providing connection information in Data Explorer

    Providing connection information in Data Explorer

    If the window shown in Figure 6-4 does not display and another window results in "Failed to find or load the registered .Net Framework Data Provider",then the following steps are needed to resolve the error:
    a. Open the DB2 Command window. Click Start Programs IBM DB2 Command Line Tools Command Window.
    b. At the prompt in the DB2 Command window, enter the following command:
    db2lswtch.exe –promote Repeat the procedure to add DB2 connection.

Visual Studio 2005 Add-In: IBM Designer
IBM Designer provides tools to create various database objects. It can be used to create and alter tables, views, scripts, and procedures.

IBM Table Designer
The IBM Table Designer can be used to create a new table. From Server Explorer, chose Data Connections database, right-click Tables node, and select Add New Table with Designer as shown below

Starting IBM Table Designer

Starting IBM Table Designer

Note: The wizard and designer can both be used to create the same database objects. The wizard, however, is targeted to novice users who prefer step-by-step creation while the designer allows a more advanced user to switch between views and other applications in the design process. The Table Designer window shows Table Definition, Columns, and Column properties section as below

Table Designer window

Table Designer window

The following menus are provided in Table Designer window:

  • Column Definitions View (Default): Allows you to define columns and their data types.
  • Keys View: Allows defining primary keys, unique keys, and foreign keys.
  • Indexes View: Allows creating indexes for the columns defined in the columns view.
  • XML Indexes View: Allows creating indexes for any tags in XML document.
  • Check Constraints View: Allows adding check constraints for the table and its columns.
  • Triggers View: Allows adding triggers to a table.
  • Privileges View: Allows adding roles and privileges to the users.
  • Show Script View: This shows the create table statement command.

IBM View Designer
The IBM View Designer can be used to create a new view by right-clicking Views node in Server Explorer under Data Connections database, and selecting

Add New View with Designeras shown below

Starting IBM View Designer

Starting IBM View Designer

The View Designer window is shown below

View Designer window

View Designer window

The menu provided in View Designer window includes the following:

  • View View: Provides ability to check the syntax or test execute the SQL statement provided in the view definition.
  • Triggers View: Provides ability to define and add triggers.
  • Privileges View: Allows adding roles and privileges to users.
  • Show Script View: Shows the create view statement.

IBM Procedure Designer
The IBM Procedure Designer can be used to create a new procedure by right-clicking Procedures node in Server Explorer, under Data Connections database, then selecting Add New SQL Procedure with Designer as shown below.

Starting IBM Procedure Designer

Starting IBM Procedure Designer

The Procedure Designer window is shown below.

Procedure Designer window

Procedure Designer window

The menu provided in Procedure Designer window includes the following:

  • Procedure View: Allows defining procedure parameters and procedure body.
  • Privileges View: Allows adding roles and privileges to the users or groups.
  • Show Script View: Shows the create procedure statement.

Debugging SQL procedures
Debugging support for SQL procedure has been extended to zSeries servers. Procedure can be debugged using the following steps:

  1. Create SQL procedure with Debug mode option set to ALLOW.
  2. Add breakpoints in SQL body.
  3. This can be done using Debug Toggle Breakpoint (F9), which will highlight the line and place a red dot to the left of the breakpoint as shown below. Breakpoints can be deleted by left-clicking the red dot.

    Adding debug breakpoints in Procedure Designer

    Adding debug breakpoints in Procedure Designer

  4. Start debugging using Step Into button on the toolbar.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM DB2 Topics