problem:
Mysql database connection error Connections could not be acquired from the underlying database!
Resolution process:
1. Check Hibernate.cfg.xml profile driver, URL, username and password are not the problem
2. Check the drive, no problem
3. do sql connection test, the connection is successful
Import java.sql.DriverManager; public class sqltest { Private static String url = "jdbc: MySQL: // localhost: port number / database name"; // database services address Private static String Driver = "com.mysql.jdbc.Driver "; // drive path Private static String username =" the root " ; Private static String password =" password " ; public static void main (String [] args) throws Exception { the Class.forName (driver) .newInstance (); // if the connection is successful, the print connection System.out.println(DriverManager.getConnection(url, username, password)); } }
4. Carefully error View: find such a
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
Unable to get resource pooling resources from its main factory or source, database connection test successful
Description resource pool may be the problem, refer to the blogger 's practice, thus replacing the resource pool jar package, failed.
5.https://blog.csdn.net/qinguanglong6606/article/details/100560901
Most of the night, tiring of [your hands], then stand tomorrow.
the reason:
solution: