How to store chinese characters in MySQL
843841Jun 14 2004 — edited Jul 2 2008Hi,
I am going to store chinese character in MySQL ver3.23. User will input chinese characters in a HTML FORM and then the character will be stored to the MySQL Database by the Servlet Program.
Here is the servlet code:
Connection conn = new Connection(......);
String stmtStr = "UPDATE USER_PROFILE SET USER_NAME=?, USER_CHI_NAME=? WHERE LOGIN_ID=?;";
PreparedStatement stmt = conn.prepareStatement(stmtStr);
stmt.setString(1, userName);
stmt.setBytes(2, userChiName.getBytes("big5"));
stmt.executeUpdate();
it doesn't work and I found the stored character became question mark in MySQL database. How can I stored the chinese character in MySQL3.23? Or any other version?