Ketan
Ketan

Reputation: 3282

Store and retrieve Japanese characters in mySQL database in Spring MVC based application

I am building one web application using:

I want to add internationalization support for Japanese language in my app.

To display label and messages from properties file in japanese language , I have made use of Spring Locale Interceptor and its working fine.

What I need , I want to store Japanese characters in Database (not in Unicode) from user inputs and want to display on page.

Also , when i enters Japanese characters in form , in POJO, it is automatically converted in unicode, how can i disable this behaviour?

Upvotes: 1

Views: 1936

Answers (1)

t_motooka
t_motooka

Reputation: 565

To store or read characters in the database with explicitly specified encoding, use useUnicode and characterEncoding properties in your JDBC URL. see http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-charsets.html and http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html

In the 2nd question, do you mean that you want to use byte[] instead of java.lang.String when you treat input strings? I think you can do it, but I can not recommend it.

Upvotes: 1

Related Questions