search

Home  >  Q&A  >  body text

java - 最近在学ssm框架在写Test的时候,不能插入中文数据,但是英文可以!求解啊!

如图所示,一插入中文就保存,sql是????的!

迷茫迷茫2807 days ago704

reply all(3)I'll reply

  • 黄舟

    黄舟2017-04-18 10:51:39

    Is the database character set correct?

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-18 10:51:39

    Is the data type specified by your dept_name a string type?

    reply
    0
  • PHPz

    PHPz2017-04-18 10:51:39

    I found the error. It turned out that I did not set the character encoding in the text fromatting in the Format when modeling and generating the database in PowerDesigner. I set it to utf-8 and regenerated the SQL to import the database successfully.
    Reference: http://blog.csdn.net/qdzeac/a...

    reply
    0
  • Cancelreply