Tests the network response time of
the underlying connectivity between a client and a database server.
This API can be used by an application when a host database server
is accessed via DB2 Connect™ either directly or through a gateway.
Required connection
Database
API include file
db2ApiDf.h
API and data structure syntax
SQL_API_RC SQL_API_FN
db2DatabasePing (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2DatabasePingStruct
{
char iDbAlias[SQL_ALIAS_SZ + 1];
db2int32 RequestPacketSz;
db2int32 ResponsePacketSz;
db2Uint16 iNumIterations;
db2Uint32 *poElapsedTime;
} db2DatabasePingStruct;
SQL_API_RC SQL_API_FN
db2gDatabasePing (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2gDatabasePingStruct
{
db2Uint16 iDbAliasLength;
char iDbAlias[SQL_ALIAS_SZ + 1];
db2int32 RequestPacketSz;
db2int32 ResponsePacketSz;
db2Uint16 iNumIterations;
db2Uint32 *poElapsedTime;
} db2gDatabasePingStruct;
db2DatabasePing API parameters
- versionNumber
- Input. Specifies the version and release of the DB2® database or DB2 Connect product that the application
is using.
- pParmStruct
- Input. A pointer to the db2DatabasePingStruct structure.
- pSqlca
- Output. A pointer to the sqlca structure.
db2DatabasePingStruct data structure parameters
- iDbAlias
- Input. Database alias name. Reserved for future use. If a value
is provided, it is ignored.
- RequestPacketSz
- Input. Size of the packet (in bytes) to be sent to the server.
The size must be between 0 and 32767 inclusive. This parameter is only valid on servers running DB2 Universal Database™ (UDB) for Linux, UNIX and Windows Version 8 or higher, or DB2 UDB for z/OS® Version
8 or higher.
- ResponsePacketSz
- Input. Size of the packet (in bytes) to be returned back to client.
The size must be between 0 and 32767 inclusive. This parameter is only valid on servers running DB2 UDB for Linux, UNIX and Windows Version 8 or
higher, or DB2 UDB for z/OS Version 8 or higher.
- iNumIterations
- Input. Number of test request iterations. The value must be between 1 and 32767 inclusive.
- poElapsedTime
- Output. A pointer to an array of 32-bit integers where the number
of elements is equal to iNumIterations. Each
element in the array will contain the elapsed time in microseconds
for one test request iteration.
Note: The application is responsible
for allocating the memory for this array before calling this API.
db2gDatabasePingStruct data structure specific parameters
- iDbAliasLength
- Input. Length of the database alias name. Reserved for future
use.
Usage notes
This API will not work when
it is used from a DB2 UDB Version
7 client through a DB2 Connect Version 8 to a connected DB2 host database server.