UTF - 8 with JPA and Glassfish 4.0

后端 未结 2 2041
無奈伤痛
無奈伤痛 2020-12-28 10:37

I am having difficulties with UTF-8 characters. This is a simple JSF project. I use JSF 2.2 and Glassfish 4.0

I have a method where I go:

em.persist(         


        
2条回答
  •  生来不讨喜
    2020-12-28 11:26

    This solved it:

    jdbc:mysql://localhost:3306/fus?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8

    so this was wrong:

    jdbc:mysql://localhost:3306/fus?useUnicode=true&connectionCollation=utf8_general_ci&characterSetResults=utf8

提交回复
热议问题