Can someone please explain why the following program timeout after 3 seconds where as I set it to do so after
12 seconds. I deliberately turned off mysql server to test this
If the MySQL server is not running the connection does not time out; the operating system replies with a "connection refused" error immediately. To make the connection time out one thing you can do is configure a fire wall to drop all packets arriving to the MySQL port.