第一步先搭建入门工程结构
在src文件同级创建文件夹专门放mybatis配置文件
工程结构如:
![](https://img2018.cnblogs.com/blog/1275569/201904/1275569-20190407141421356-73394038.png)
1.log4j2.sqlmapconfig.xml
![](https://img2018.cnblogs.com/blog/1275569/201904/1275569-20190407141537666-625229238.png)
![](https://img2018.cnblogs.com/blog/1275569/201904/1275569-20190407141549085-26308021.png)
2.![](https://img2018.cnblogs.com/blog/1275569/201904/1275569-20190407142548934-535589717.png)
![](https://img2018.cnblogs.com/blog/1275569/201904/1275569-20190407143029318-1120841924.png)
关于碰到的问题:
![](https://img2018.cnblogs.com/blog/1275569/201904/1275569-20190407172110752-991351321.png)
The method selectOne(String, Object) in the type SqlSession is not applicable for the arguments (String, int)
解决办法:
更换jre或jdk然后在改回即可,(不明白为什么是这样)
参考连接:
https://bbs.csdn.net/topics/392156011