EPUB | CHM | PDF

TMySQLDatabase.Methods.Ping

Top Previous Next

Pings MySQL server.

Syntax:

function Ping : Integer;

Description:

Checks if the connection to the server is working. If it has gone down, an automatic reconnection is attempted. Returns 1 if the server is alive and 0 if an error occurred.

note Negative result (0) does not indicate whether the MySQL server itself is down; the connection might be broken for other reasons such as network problems.

tip This function can be used by clients that remain idle for a long time to check if the server has closed the connection and reconnect if necessary.