Docker Jenkins container and MySQL container are connected, plug-in connection succeeded and application connection failed

  docker, question

Audit to Database Plugin in Jenkins container
Host in URL is named MySQL container, or private IP in docker network has been successfully connected.
Java application, written in URL, if using container name, report
java.net.UnknownHostException: db(db is MySQL container name)
If you write a private address, report
java.net.SocketTimeoutException: connect timed out
The two containers are connected in the same bridge network of docker.

The host in the URL was successfully changed to the IP of the host.