Advanced Database Feature Guide


Environment, Connection and Statement Attributes

Environments, connections, and statements each have a defined set of attributes (or options). All attributes can be queried by the application, but only some attributes can be changed form their default values. By changing attribute values, the application can change the behavior of DB2 CLI.

An environment has attributes that affect the behavior of DB2 CLI functions under that environment. The application can specify the value of an attribute. The application can access or change the value of an attribute by asking UtyDB2Database driver object for its database environment.

UtyDB2DatabaseManager dbEnvironment 

A complete list of the environment list attributes can be obtained opening a browser on the UtyDB2Environment class and examining the instance UtyDB2-Attributes-API category.

A connection has attributes that affect the behavior of DB2 CLI functions under that connection. Of the attributes that can be changed:

Connection attribute information can be changed directly using instance methods on the UtyDB2Connection class, indirectly using instance methods on the UtyDB2ConnectionDescriptor class, or globally using class methods on the UtyDB2ConnectionDescriptor class. In all cases, the methods relating to connection attribute information are categorized as UtyDB2-Attributes-API.

A statement has attributes that affect the behavior of CLI functions executed using that statement. Of the statement handles can be changed:

Statement attribute information can be changed directly using instance methods on subclasses of the UtyDB2Statement class, indirectly using instance methods on subclasses of the UtyDB2SqlDescriptor class, or globally using class methods on the UtyDB2SqlDescriptor class. In all cases, the methods relating to statement attribute information are categorized as UtyDB2-Attributes-API.

Many applications use just the default attribute settings; however, there may be situation where some of these defaults are not suitable for a particular user of the application. DB2 CLI provides end users with two methods to change some of these default values at run time. The first method is to specify the new default attributes values in the connection string input to the UtyDB2Database class>>connectUsing: method. The second method involves the specification of the new default values in a DB2 CLI initialization file

The DB2 CLI initialization file can be used to change default values for all DB2 CLI applications on that workstation. This may be the only means of changing the defaults if the application does not provide a means for the user to provide default attributes values using the UtyDB2DatabaseManager class>>connectUsing: method. Default attributes values specified in this manner override the values in the DB2 CLI initialization file for that particular connection. For information on how to use the DB2 CLI initialization file as well as for a list of changeable defaults, refer to "DB2 CLI/ODBC Configuration Keyword Listing" section of the DB2 CLI Guide and Reference manual.

The mechanism for changing default values is intended for post-development tuning; application developers must use the appropriate set-attribute method. If an application does call a set-attribute method with a value different from the initialization file or the connection string specification, then the initial default value is overridden and the new values takes effect.

For information on come commonly used attributes, refer to Appendix A, "Programming Hints and Tips", of the DB2 CLI Guide and Reference manual.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]