0

When I execute SQL query contains chines character, the query is executed successfully. When I open the mysql query browser I could see only ???? instead of Chinese texts. If the same query executed from the mysql query browser it works fine.

2 Answers 2

4

Try connecting with following switch

 String url = "jdbc:mysql://host/database?characterSetResults=UTF-8&characterEncoding=UTF-8&useUnicode=yes";
Sign up to request clarification or add additional context in comments.

Comments

0

All encoding must be the same (there are exceptions but let's forget them): the encoding used by the DB, the connection encoding use by the Java process and the one used by the query browser. You need to change the one used by Java, since the other two seem to be OK.

1 Comment

I have solved the problem thank you for the reply. i have used the code given by joshi it worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.