You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nguyen Xuan Son <nr...@ed.ritsumei.ac.jp> on 2009/12/14 06:04:07 UTC
unicode character is in wrong format
dear all
im using PreparedStatement.setNString(int, String)
to insert the japanese characters into my MySQL database
but the result is all in "?????????" characters
PreparedStatement pstmt = conn.prepareStatement(sql5);
pstmt.setNString(3, item.getTitle());
rs = pstmt.executeUpdate();
do you have any suggestion?
--
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son
Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax : 81-(0)90-3976 2246
Email : nr0003xx@ed.ritsumei.ac.jp
Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
=======================================================================
Re: unicode character is in wrong format
Posted by Alex Siman <al...@gmail.com>.
Here is the best checklist for Java webdev + UTF-8
http://stackoverflow.com/questions/138948/how-to-get-utf-8-working-in-java-webapps
Nguyen Xuan Son-2 wrote:
>
> dear all
> im using PreparedStatement.setNString(int, String)
> to insert the japanese characters into my MySQL database
> but the result is all in "?????????" characters
>
> PreparedStatement pstmt = conn.prepareStatement(sql5);
> pstmt.setNString(3, item.getTitle());
> rs = pstmt.executeUpdate();
>
> do you have any suggestion?
>
> --
> =======================================================================
> Ritsumeikan University, Asia JinZai Project
> Master of Information Science
> Nguyen Xuan Son
>
> Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> ShiteiHaimu
> Rien, Room 103
> Tel/Fax : 81-(0)90-3976 2246
> Email : nr0003xx@ed.ritsumei.ac.jp
> Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
> =======================================================================
>
>
--
View this message in context: http://old.nabble.com/unicode-character-is-in-wrong-format-tp26773061p26780218.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: unicode character is in wrong format
Posted by Paul Benedict <pb...@apache.org>.
Nguyen,
On 12/13/2009 11:04 PM, Nguyen Xuan Son wrote:
> dear all
> im using PreparedStatement.setNString(int, String)
> to insert the japanese characters into my MySQL database
> but the result is all in "?????????" characters
>
> PreparedStatement pstmt = conn.prepareStatement(sql5);
> pstmt.setNString(3, item.getTitle());
> rs = pstmt.executeUpdate();
>
> do you have any suggestion?
>
Most likely your (1) tables/columns are not using UTF-8 to store data
and (2) neither is your MySQL database connection.
Do a google search to learn how to store international characters in
MySQL and JDBC.
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org