Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem to insert Chinese Characters(GB3212) into MySQL

843830Jul 31 2010 — edited Aug 1 2010
I met a problem to insert Chinese Characters (GB3212) into MySQL using Entity Bean (or JPA).
For example, when a hardcoded string "{color:#ff0000}电器me元件{color}" is inserted, it is displayed as "{color:#ff0000}??me??{color}" in MySQL.

The NamedQuery is also not working for Chinese Characters.

The setting are as following:
GlassFish JDBC connection pool: useUnicode=true, charecterEncoding=gb2312
NetBeans IDE: source encoding set to GB2312;
MySql table: the column set to CHARACTER SET gb2312;

Any experts, please give advice

Thanks lot
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2010
Added on Jul 31 2010
2 comments
358 views