mybatis异常

来源:互联网 发布:mysql 查询最小的数据 编辑:程序博客网 时间:2024/06/05 08:54

1.mybatis配置数据源的时候遇到一个异常:

Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: com.mysql.jdbc.Driver 


驱动包也导入了,查了很多资料也没有解决,最后发现时数据源配置信息中存在空格引起的,如:com.mysql.jdbc.Driver 后面有空格。将空格去掉,错误消失!

0 0
原创粉丝点击