Skip to main content

skip to main content

developerWorks  >  Information Management  >

Optimize your existing .NET applications using IBM Data Studio's pureQuery

Improve performance and security for existing .NET applications that access DB2

developerWorks
Go to the previous pagePage 4 of 11 Go to the next page

Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
914 KB (21 pages)

Get Adobe® Reader®

Discuss


My developerWorks needs you!

Connect to your technical community


Rate this tutorial

Help us improve this content


Enable pureQuery for the IBM Data Server Provider for .Net

The IBM Data Server Provider for .Net, which is IBM's recommended .NET data provider for DB2 databases, has been extended to provide pureQuery functionality that enables you to selectively dynamically or statically execute an application's SQL without having to modify your existing application. This pureQuery-enabled provider is included in the following products:

  • IBM Data Server Driver for ODBC, CLI, and .NET, Version 9.5.3 (or later)
  • IBM Data Server Runtime Client, Version 9.5.3 (or later)
  • IBM Data Server Client, Version 9.5.3 (or later)
  • DB2 for Linux®, UNIX®, and Windows®, Version 9.5, Fix pack 3 (or later)

The provider's pureQuery functionality is a separately licensed feature and is disabled by default. To unlock the functionality, you must acquire an IBM Data Studio pureQuery Runtime license and apply it. This section of the tutorial walks you through the process of installing the pureQuery Runtime and shows you how to apply the pureQuery license.

Install the pureQuery Runtime

To install your licensed pureQuery Runtime on the machine where your .NET application resides, download it from Passport Advantage and follow the simple instructions that are well documented in the pureQuery Runtime installation section of the Integrated Data Management Information Center. (See Resources for a link to the Information Center to access the instructions.)



Back to top


Activate the IBM Data Server Provider's pureQuery functionality

The pureQuery license activation steps vary depending on which of the above products you have installed.

If you installed the IBM Data Server Driver for ODBC, CLI, and .NET, copy the license file dspq_rt.lic, which you can find in the (default pureQuery Runtime installation) directory C:\Program Files\IBM\Data Studio pureQuery Runtime\pureQuery\, to the driver's licence directory. This .NET provider license directory is located by default in C:\Program Files\IBM\IBM DATA SERVER DRIVER\license\.

If you installed the .NET driver as part of another DB2 client or as part of a data server, use the DB2 License Center or run the DB2 license management command, and specify the full path and license file name as a command line parameter:

db2licm -a "C:\Program Files\IBM\Data Studio pureQuery Runtime\pureQuery\dspq_rt.lic"

Once you've activated the pureQuery license, you are ready to step through the process that enables your existing application for pureQuery.



Back to top


Select a .NET application for this tutorial

The pureQuery functionality of the IBM Data Server Provider for .Net is configured by adding custom properties to the application's database connection string. To keep it simple, this tutorial uses the testconn20.exe utility as the .NET application, which is included in DB2 client and data server installations (in the C:\Program Files\IBM\SQLLIB\BIN\ directory). This utility is commonly used to validate that the IBM Data Server Provider for .Net is configured correctly. It takes as an argument a database connection string, which can be easily manipulated, as shown in Figure 4. The utility only accesses catalog tables and can therefore be used with any database. For illustrative purposes, this tutorial uses the GSDB database, which is commonly used as a data source in Data Studio tutorials.


Figure 4. Example program output
Example program output


If you prefer, you can follow this tutorial using an application that you've developed and that you are familiar with as long as you can manipulate its database connection string.



Back to top



Go to the previous pagePage 4 of 11 Go to the next page