1.Mybatis获取SqlSession时报空指针错误:
at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.
MyBatis: can configure multiple environments, can only choose ONE per SqlSessionFactory instance.
2.MyBatis配置Sql数据源URL的分隔符:
The connection property 'useUnicode' only accepts values of the form: 'true', 'false', 'yes' or 'no'. The value 'true;characterEncoding=utf-8' is not in this set.
1 <property name="url" value="mysql:jdbc://localhost:3306/test?useSSL=true&useUnicode=true&characterEncoding=UTF-8" </property>
// 当useUnicode设置为true时,再设置字符编码为UTF-8
// JDBC版本与MySQL版本不兼容 使用useSSL
在xml配置文件中,参数之间用&隔开,而不是&