×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT技术讨论 / 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"?
    • 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),
      sometime you need use String.encode() to get correct answer. have a fun!