您的位置:首页 > 产品设计 > UI/UE

QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in

2018-01-21 20:55 495 查看
1.注意有没有dataSoure:配置文件是否有误

2.有没有connection:runner()里面是否添加ds参数.

12.Connections could not be acquired from the underlying database!

以上问题可能有一下原因造成:

1,驱动配置有误:driver=com.mysql.jdbc.Driver

2,数据库连接地址有误:url=jdbc:mysql://localhost:3306/test?3useUnicode=true&characterEncoding=utf8

3,密码或帐号有误:username=root

      password=root

4,数据库未启动或无权访问

5,项目未引入对应的驱动jar包mysql-connector-java-5.1.6-bin.jar

6,mysql root没有远程访问的权限,需要增加权限,增加权限的步骤如下:

进入mysql数据库:

grant all privileges on *.* to 'root'@'%' identified by 'root' withgrant option;

flush privileges;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐