用mybatis进行数据库增删改查操作
UserMapper:
UserMapper.xml:
TestUserDao:
测试发现加入红框内中文注释后会报java.lang.ExceptionInInitializerError等错误
将xml中文注释删去后恢复正常
或者将UserMapper.xml和mybatis-config.xml中的encoding改为“GBK”
不能直接删去encoding并且两个文件都要改,此时加入中文注释不影响运行。
用mybatis进行数据库增删改查操作
UserMapper:
UserMapper.xml:
TestUserDao:
测试发现加入红框内中文注释后会报java.lang.ExceptionInInitializerError等错误
将xml中文注释删去后恢复正常
或者将UserMapper.xml和mybatis-config.xml中的encoding改为“GBK”
不能直接删去encoding并且两个文件都要改,此时加入中文注释不影响运行。