java.sql.SQLException: No suitable driver

在配置数据库连接池的时候,会易出错

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: 
  Failed to obtain JDBC Connection; nested exception
is java.sql.SQLException: No suitable driver

 

需要注意的几点:

  1、db.properties文件是否书写正确

 如下面的 Drivers多了个"s";
jdbc.driver=com.mysql.jdbc.Drivers
jdbc.url=jdbc:mysql:///book_db
jdbc.username=root
jdbc.password=6112783king

  

  2、db.properties文件不能有多余的"空格"

  不能在语句的后面添加空格,这样会导致不能解析



posted @ 2019-11-16 14:37  JAHC  阅读(202)  评论(0)    收藏  举报