Start of change

DatabaseMetaData methods for identifying the type of data server

Use the DatabaseMetaData.getDatabaseProductVersion method to identify the data server to which an application is connected. Use the DatabaseMetaData.getDatabaseProductName method to obtain additional information about the data server.

Important: DatabaseMetaData.getDatabaseProductVersion is the preferred method for determining the data server and version because the returned value is in the standard product identifier (PRDID) format.

The format for data servers other than Db2® on Linux, UNIX, and Windows systems is:

pppvvrrm

The format for Db2 on Linux, UNIX, and Windows systemsdata servers is:

pppvvrrmf

The parts of the product identifier are

ppp
The 3-byte product code:
ARI
Db2 Server for VM and VSE
DSN
DB2 for z/OS®
QSQ
Db2 for IBM® i
SQL
Db2 on Linux, UNIX, and Windows systems
vv
The 2-byte version identifier.
rr
The 2-byte release identifier.
m
The 1-byte modification identifier.
f
The 1-byte fix pack identifier. The fix pack identifier is included only for Db2 on Linux, UNIX, and Windows systems data servers.

The following table shows examples of values that are returned by DatabaseMetaData.getDatabaseProductVersion.

Table 1. Examples of values returned by DatabaseMetaData.getDatabaseProductVersion
Returned value Database product version
DSN11015 DB2 for z/OS Version 11 in new-function mode
SQL11010 Db2 on Linux, UNIX, and Windows systems Version 11.1 GA
SQL110122 Db2 on Linux, UNIX, and Windows systems Version 11.1 mod pack 2 fix pack 2
IFX11100 IBM Informix® Version 11.10

DatabaseMetaData.getDatabaseProductName is a method for obtaining additional information about the data server and its operating system. DatabaseMetaData.getDatabaseProductName returns a free-form string.

Important: Do not use DatabaseMetaData.getDatabaseProductName as the only method for determining the data server type. The contents of the returned string might change between data server versions and between driver versions.

The following table shows examples of values that are returned by DatabaseMetaData.getDatabaseProductName.

Table 2. Examples of values returned by DatabaseMetaData.getDatabaseProductName
Returned value Database product
DB2 DB2 for z/OS
DB2 for z/OS VUE DB2 for z/OS Value Unit Edition
DB2/LINUXX8664 DB2 on Linux on x86
IBM Informix/UNIX64 IBM Informix on UNIX
End of change