I am using mysql query browser to store the following names in the Person table which contains fields of personNumber and personName. I have the character set of personName at utf-8 and if i insert the name via query browse the query is running correctly but when i try that via JDBC or JPA, the name's special characters become the '?'. What is the problem here?...
The names are 1.Năstase 2.Hrustanović 3.Ogris-Martič and some similar names.
您是否正确设置了连接字符串?
jdbc:mysql://localhost:3306/administer?characterEncoding=utf8
试试这个代码
jdbc:mysql://localhost:3306/MY_DB?useUnicode=yes&characterEncoding=UTF8
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.