tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Wallace" <pwall...@twowaytv.com.au>
Subject PreparedStatement & Unicode & MySQL
Date Mon, 12 Sep 2005 02:13:07 GMT
Hi,
    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`)
) CHARACTER SET utf8 TYPE=MyISAM; 
 
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
 
Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message