Updated on 2025-10-23 GMT+08:00

connection.ping(reconnect = True)

Description

This method checks whether the database connection is available. If the connection is disconnected or unavailable, determine whether to reconnect to the database based on the parameter settings. If the reconnection fails, an error is reported.

Prototype

connection.ping(reconnect = True)

Parameters

Table 1 connection.ping(reconnect = True)

Keyword

Parameter Description

reconnect

Specifies whether to reconnect. The default value is True.

Return Value

None

Examples

For details, see Examples: Common Operations.