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
Connections could not be acquired from the underlying database!的更多相关文章
- 【JDBC 报错】Connections could not be acquired from the underlying database!
项目启动报错: [2016-07-13 10:04:15,074] ERROR org.apache.ibatis.executor.BaseExecutor Could not get a data ...
- JavaWeb:c3p0配置问题-----java.sql.SQLException: Connections could not be acquired from the underlying database!
错误原因 c3p0的配置错误 错误显示 -classpath "D:\Program\Software\IntelliJIDEA\IntelliJ IDEA 2018.2.5\lib\ide ...
- 数据库连接问题之:Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
要么是驱动问题(没加载到工程中去或者其他问题)要么是账号密码或者url或者driver写错 driver:com.mysql.jdbc.Driver url:jdbc:mysql://localhos ...
- c3p0:Connections could not be acquired from the underlying database!解决方案
在利用ssh框架做网站的时候遇到了一个比较棘手的问题,一直连接不上数据库,问题描述如下: 各种百度然后说的最多的解决方案是: 1,驱动配置有误:2,数据库连接地址有误:3,密码或帐号有误: 4,数据库 ...
- dea创建Maven工程用c3p0连接数据库报错java.sql.SQLException: Connections could not be acquired from the underlying
idea java.sql.SQLException: Connections could not be acquired from the underlying database! 转载自:ht ...
- JAVA 问题集中之处以及解决的办法
也许当你看的时候,你可能认为这些都是简单的问题,有什么好记的.其实不是,我认为,我们往往是因为粗心而造成的错误,当你在开发中碰到这些问题时,你能一下看出来是什么错误,达到提高效率.而且往往你把小的问题 ...
- 连接mysql提示com.mchange.v2.resourcepool.BasicResourcePool
1.com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6ff9129c com.mchange.v2.resourc ...
- spring+hibernate常见异常集合
spring+hibernate出错小结: (1)java.lang.NoClassDefFoundError: org/hibernate/context/CurrentSessionContext ...
- 搭建SSH入过的那些坑
1.添加完相关jar包,写完配置文件,写完测试类,运行提示 WARN:Establishing SSL connection without server's identity verificatio ...
随机推荐
- Unity 2017 Scene界面与Game界面显示不同/过于灰暗的解决办法
场景界面的显示过于灰暗,严重影响工作心情. 切换到游戏界面时的颜色. 只要将场景中全部摄像机的[Allow HDR]取消勾选即可.
- Ubuntu使用Nginx 部署你的静态网页
首先使用Putty 登录填写名称 unbutu 然后获取管理员权限 sudo -i 首先更新APT库sudo apt-get updatesudo apt-get upgrade 安装 git,su ...
- 从零实现Linux一键自动化部署.netCore+Vue+Nginx项目到Docker中
环境搭建 1.安装Linux,这里我用的阿里云服务器,CentOS7版本 2.进入Linux,安装Docker,执行以下命令 sudo yum update #更新一下yum包 sudo yum in ...
- .net mvc 微信公众号 验证微信签名
官方文档:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421135319&token=&lang=zh_CN ...
- MacOS下解决宿主机和docker容器之间网络互通
docker在Mac下使用非常方便,官网提供了desktop版本的可视化软件,甚至还十分贴心地集成好了k8s套件.然而如果想同时部署和使用多个容器,每个容器不使用127.0.0.1地址,而是各自有ip ...
- Git提交错了不用慌,这三招帮你修改记录
大家好,今天我们来聊聊git当中一个很重要的功能--历史记录的修改. 有的时候我们会突然发现某个地方需要修改,最常见的某个不应该被提交的文件被提交了进来.我们希望它不只是在后序的版本当中不再出现,而是 ...
- 搭建web攻防环境
提示:本实验仅用于学习参考,不可用作其他用途! 任务一.基于centos7搭建dvwa web服务靶机 在centos7安装LAMP并启动,访问phpinfo页面 从互联网下载dvwa并解压到/var ...
- swap是干嘛的?
本文截取自:http://hbasefly.com/2017/05/24/hbase-linux/ swap是干嘛的? 在Linux下,SWAP的作用类似Windows系统下的"虚拟内存&q ...
- 盘点 Java 开发 2020 年发生的几件大事,你必须得知道!
2021 年了,在过去的一年 Java 软件开发行业都发生了哪些重大事件呢? 这篇栈长带大家回顾一下,其实在元旦的<滚蛋吧,2020>也略有介绍,这篇就更加详细的总结一下. 1.Java ...
- TurtleBot3 Waffle (tx2版华夫)(8)键盘控制
1)[Remote PC] 启动roscore $ roscore 2)[Turbot3] 启动turbot3 $ roslaunch turbot3_bringup minimal.launch 3 ...