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&amp;useUnicode=true&amp;characterEncoding=UTF-8" </property>
// 当useUnicode设置为true时,再设置字符编码为UTF-8
   // JDBC版本与MySQL版本不兼容 使用useSSL

 

在xml配置文件中,参数之间用&amp;隔开,而不是&

 

posted on 2017-10-03 01:04  lix_y  阅读(261)  评论(0编辑  收藏  举报