If the application has an open connection for a long time, it is recommended to check a connection for validation before using it. Call of Ping method has single round trip on MySQL server.
It is not a good idea to keep a connection open for long time. Connection pool automatically pings all connections within, thus closing old connections and opening new ones is encouraged.
This method does not throw exceptions. It does not close the connection if it is invalid, it just marks it to forbid putting the invalid connection to the pool when closing.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2