I need to insert Chinese characters inside Oracle Data base using Java (hibernate 3.0 /jpa), I tried many methods and failed.
When I persist the entity I see (??? ) in the filed and when I retrieve the value I see the same result.
My Oracle NLS_DATABASE_PARAMETERS:
NLS_CHARACTERSET WE8MSWIN1252
NLS_NCHAR_CHARACTERSET AL16UTF16
The column type is Nvarchar. I set this properties in persistence.xml
<property name="hibernate.connection.useUnicode" value="true" />
<property name="hibernate.connection.characterEncoding" value="UTF-8"/>
<property name="hibernate.connection.charSet" value="UTF-8"/>
I had the same problem in SQL server and there we solved it by converting all the varchar fields to nvarchar. Also all the corresponding store procedures and return types need to be changed. Make sure all you procedures also have nvarchar datatype