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.
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.
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.
The following table shows examples of values that are 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 |