• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

hibernate struts2 spring整合的框架无法插入中文,报错如下

数据库连接的properties文件已加上useUnicode=true&characterEncoding=utf8数据库表也已设置为utf-8


  • <hr>
  • Struts Problem Report
  • Struts has detected an unhandled exception:
  • Messages:

    • Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87' for column 'pname' at row 1
    • Hibernate operation: could not insert: [com.umbrella.ssh.domain.Product]; uncategorized SQLException for SQL [insert into product (pname, price) values (?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87' for column 'pname' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87' for column 'pname' at row 1
    File:com/mysql/jdbc/SQLError.java
    Line number:1,056

  • Stacktraces
  • org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [com.umbrella.ssh.domain.Product]; uncategorized SQLException for SQL [insert into product (pname, price) values (?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87' for column 'pname' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87' for column 'pname' at row 1
  •     org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)    org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)    org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)    org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)    org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)    org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:412)    org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:375)    org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:684)    com.umbrella.ssh.dao.ProductDao.save(ProductDao.java:11)    com.umbrella.ssh.service.ProductService.save(ProductService.java:20)    com.umbrella.ssh.service.ProductService$$FastClassBySpringCGLIB$$f8c996e2.invoke()

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

发新帖

发布任务需求已有1031167位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!