Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There could be multiple reasons for failure to obtain a JDBC connection in Spring Boot. Some of the common reasons are:

  1. Incorrect database credentials: If the database credentials in the application.properties file are incorrect, then the connection to the database will fail.

  2. Database server not running: If the database server is not running, then the application will not be able to establish a connection to the database.

  3. Connection pool exhaustion: If the maximum number of connections in the connection pool has been reached, then any further attempts to obtain a connection will fail.

  4. Network connectivity issues: If there are network connectivity issues between the application server and the database server, then the connection to the database will fail.

  5. Driver issues: If the JDBC driver is not loaded correctly or is incompatible with the database version, then the connection to the database will fail.

  6. Firewall and security settings: If the firewall and security settings block the connection to the database, then the connection will fail.