zoukankan      html  css  js  c++  java
  • Connections could not be acquired from the underlying database!

    Connections could not be acquired from the underlying database!

    报错截图:

    报错内容:

    Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underlying database!
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:692)
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
    at com.courage.pool.c3p0.C3P0Test.main(C3P0Test.java:38)
    Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
    at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1469)
    at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644)
    

    报错原因:

    参考链接:MySQL JDBC Driver 5.1.33 - Time Zone Issue

    MySQL JDBC驱动程序的5.1.33后面的版与UTC时区一起使用,必须serverTimezone在连接字符串中显式指定。

    解决办法:

    在url后面加上时区信息:

    jdbc:mysql://localhost:3306/jdbc?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
    
  • 相关阅读:
    关于区间数颜色的主席树解决
    1020考试总结
    QR算法
    新的征程
    端点星2020.12.2联赛
    自我介绍&友链
    3个搜索
    搜索格式这样写
    T107073 归并排序
    还有这个题
  • 原文地址:https://www.cnblogs.com/Courage129/p/14158310.html
Copyright © 2011-2022 走看看