Set Up .NET Application to Optimize SQL Queries (DB2)
Use the Set Up .NET Application to Optimize SQL Queries window to
select the DB2® data connections to
associate with SQL statements that you want to capture in a .NET
application.
After you bind the captured SQL statements to the data connections,
you then can use this wiundow to set SQL to run statically on those
connections.
You also can use this window to provide the names of files and objects
to use in the capture, binding, and running processes.
To open the Set Up .NET Application to Optimize
SQL Queries window:
In the Solution Explorer, right-click the .NET application project
folder, and then select Optimize IBM SQL Queries.
Connection
Shows the information for a data connection, as it
is displayed in the Server Explorer.
Capture SQL
Select the value that reflects the action that you
want to perform.
On - Select for a data connection
that you want to associate with SQL statements in
the .NET application.
If a data connection that you want to use is not shown
in the window, click New Connection
to add the connection.
Off - Select for a data connection
on which you do not want to capture SQL statements.
Also select for a data connection on which you want
to run captured and bound SQL statements statically.
You cannot set Run SQL to
Static on a connection when
Capture SQL is set to
On.
Capture File
Specify the full path to the file in which to store
the captured SQL statements.
The default directory is C:\temp, and the
default file name is the project name of the .NET
application.
If you change the file name, the extension must remain
.capt.
Note: If you capture SQL
statements for only some of the data connections
at a given time, consider changing the file names
so that previous capture information is not
overwritten.
Collection
Specify the name for the group of packages that have
the same schema qualifier.
The default collection name is the name of the current
schema in the database that is associated with the data
connection.
Package
Specify the name of the object that will contain the
set of statically bound SQL statements.
The default package name is PKGn,
where n is 1 for the first data connection and
is incremented by 1 for each additional connection.
Run SQL
Select the value that indicates how to handle the SQL
statements that are associated with the connection when
the .NET application is run.
Off - Do not run the SQL statements.
Dynamic - Run the SQL statements
dynamically.
Static - Run the statements
statically. If you select Static
and the SQL statements for the connection have not
been bound, the statements run dynamically.
Trace SQL
To trace the SQL that is running statically in the application,
specify the full path to the log file.
The default directory is C:\temp, and the
default file name is the project name of the .NET
application.
New Connection
Click to specify the information for a new
DB2 data connection in the
Add
Connection window.