1.在 db.properties
jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=utf-8
2.在 XML 文件(如:hibernate.cfg.xml)里面的话 “&” 要改成 “&”
jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=utf-8
1.在 db.properties
jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=utf-8
2.在 XML 文件(如:hibernate.cfg.xml)里面的话 “&” 要改成 “&”
jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=utf-8