Java学习之旅-------------初次使用Mybatis接口开发模式遇到的问题----------持续更新
时间:
2019-07-05 22:37:34
阅读:
559
评论:
收藏:
0
[点我收藏+]
有Mybatis接口模式连接数据库遇到的问题和需要主要的问题
1.首先在pom.xml中应该吧自己的MySQL的版本和Mybatis的版本写对,以为不同的版本的MySQL的URL写法是有所不一样的。若出现此类的错误:Cannot load connection class because of underlying exception: com.mysql.cj.exceptions.WrongArgumentException: Malformed database URL, failed to parse the main URL sections.
2.我自己在写的过程中出现错误 Must specify port after ‘:‘ in connection string;也就是在url中的:后面直接加端口号;
3.出错:java.io.IOException: Could not find resource com/xxx/xxxMapper.xml;需要将文件所在的目录设置为resource类型即可;
4.出错:Type interface XXXMapper is not known to the MapperRegistry ;问题出在相应的Mapper.xml里面,仔细查看namespace,和有关路径的地方。细心细心再细心。。。
--------
Java学习之旅-------------初次使用Mybatis接口开发模式遇到的问题----------持续更新
原文:https://www.cnblogs.com/sbxx/p/11140693.html