There are many situations when an application requires information about the characteristics and capabilities of the current DB2 CLI driver or the data source that it is connected to.
One of the most common situations involves displaying information for the user. Information such as the data source name and version, or the version of the DB2 CLI driver might be displayed at connect time, or as part of the error reporting process.
These functions are also useful to generic applications that are written to adapt and take advantage of facilities that may be available from some, but not all database servers.
The following DB2 CLI functions provide data source specific information:
The getinfo.c sample, shown in Example generates the following output when connected to DB2.
Server Name: SAMPLE Database Name: SAMPLE Instance Name: db2inst1 DBMS Name: DB2/6000 DBMS Version: 05.00.0000 CLI Driver Name: libdb2.a CLI Driver Version: 05.00.0000 ODBC SQL Conformance Level: Extended Grammar