Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLNonTransientConnectionException: Cannot load connection class because of underlying exception: com.mysql.cj.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near ‘;characterEncoding=utf-8&serverTimezone=GMT’.
```java
ComboPooledDataSource ds = new ComboPooledDataSource();
try {
ds.setDriverClass("com.mysql.cj.jdbc.Driver");
ds.setJdbcUrl("jdbc:mysql://localhost:3306/myemployees?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT");
// ds.setJdbcUrl("jdbc:mysql://localhost:3306/myemployees?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT");
ds.setUser("root");
ds.setPassword("root");
return ds;
}catch (Exception e){
throw new RuntimeException(e);
}
原因是在class中不需要";"来隔开。所以去掉分号就行。醉了。