jdbc mysql loginTimeout not working

后端 未结 1 925
孤街浪徒
孤街浪徒 2021-01-16 23:23

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

1条回答
  •  忘掉有多难
    2021-01-16 23:40

    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.

    0 讨论(0)
提交回复
热议问题