创建Mybatis工程时的一些小技巧
1.快速创建多个包套文件
2.快速创建多个包
3.快速生成前半部分代码
//打一半代码
sqlSessionFactory.openSession();
//alt+enter
SqlSession sqlSession = sqlSessionFactory.openSession();
解决问题
问题1
### Error querying database. Cause: java.sql.SQLException: No suitable driver found for jdbc:mysql//localhost:3306/...
这里报错
url 格式错误,mysql后面要加:
问题2
org.apache.ibatis.binding.BindingException: Type interface com.SZX.Mapper.ParameterMapper is not known to the MapperRegistry.
问题3
### Error building SqlSession.
### The error may exist in com/SZX/Mapper/ParameterMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/SZX/Mapper/ParameterMapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Wrong namespace. Expected 'com.SZX.Mapper.ParameterMapper' but found 'com.SZX.Mapper.ParameterMapper1'.