yup, as far as I know, you should use setByte(), and preapred statment. usually when you read from and write to database, there is a implicit Type exchange, for chinese word, the encode is GB23121(for example), but english is iso-8859-1(for example),

uid (miracle)
sometime you need use String.encode() to get correct answer. have a fun!

2001-3-17 -04:00

回到话题: EJB:when I use "Prepared Statement " to access database(update a record),I set a parameter by "setString",I can not update properly if the string is Chinese ,why?should I use "setBytes"?

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论