Hi,
I am trying to insert Japanese characters in Database using hibernate. I have set the following character set property in hibernate.cfg.xml
Code:
<property name="connection.charSet">UTF-8</property>
It is working fine for Ms-SQL, but when we insert data into MySQL it is not inserting it accurately. It put question mark signs (?) in the field. The datatype for MySQL field is varchar and collation is set to sjis_japanese_ci.
I have checked the driver of MySQL, using another program directly inserting into Database using the following connection string.
Code:
jdbc:mysql://localhost:3306/newjap?useUnicode=yes&characterEncoding=sjis
it is inserting and retrieving correctly. There is some problem when we use hibernate layer.
Can you people help me out, a.s.a.p!
Hibernate version:
3.0
Mapping documents:
hibernat.cfg.xml
Name and version of the database you are using:
MySQL 5