tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Wallace" <>
Subject PreparedStatement & Unicode & MySQL
Date Mon, 12 Sep 2005 02:13:07 GMT
    I am having trouble inserting and retrieving Asian characters in my
MySQL DB using PreparedStatement. I have set up my table thus:
CREATE TABLE `messages` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `message_body` text NOT NULL,
  `sender_number` text NOT NULL,
  `shortcode` text NOT NULL,
  `image` longblob,
  PRIMARY KEY  (`id`)
and am inserting using a PreparedStatement -
pstmt.setString(indexOfColumnInQuestion, asianTextString); to insert in
to message_body. However, when viewing the column in the query browser,
and retrieving it from a ResultSet, it reads ????????????? ??? ???? and
so on (I am attempting to insert Thai characters in this instance).
Is there a method of PreparedStatement I am missing?
thanks and regards

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message