This can have one or more of the following causes:
- IP address or hostname in JDBC URL is wrong.
- Hostname in JDBC URL is not recognized by local DNS server.
- Port number is missing or wrong in JDBC URL.
- DB server is down.
- DB server doesn't accept TCP/IP connections.
- DB server has run out of connections.
- Something in between Java and DB is blocking connections, e.g. a firewall or proxy.
To solve the one or the other, follow the following advices:
- Verify and test it using
ping
.
- Refresh DNS server or use IP address instead in JDBC URL.
- Verify it in the DB configuration.
- Start the DB.
- Verify it in the DB configuration.
- Restart the DB and fix your code accordingly that it closes connections in
finally
.
- Disable firewall and/or configure firewall/proxy to allow/forward the port.
That said, the JDBC-ODBC bridge driver is a poor choice for SQL Server. Rather use its own JDBC driver or the much more performant and robust jTDS driver.