Hibernate: '\xE6\x9D\x8E\xE5\x9B\x9B' for column 'cust_name' at row 1 解决


新建Hibernate,出现异常

  1 20:11:03,117  WARN SqlExceptionHelper:137 - SQL Error: 1366, SQLState: HY000
  2  20:11:03,117 ERROR SqlExceptionHelper:142 - Incorrect string value: '\xE6\x9D\x8E\xE5\x9B\x9B' for column 'cust_name' at row 1
  3  Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute statement
  3

解决方案: Hibernate项目使用的数据库编码格式必须是utf-8

image

猜你喜欢

转载自www.cnblogs.com/browselife/p/10651217.html
今日推荐