org.springframework.dao.DataIntegrityViolationException: ###Errorupdatingdatabase. Cause:com.mysql.cj.jdbc.exceptions.MysqlDataTruncation:Datatruncation:Outofrangevalueforcolumn'article_id'atrow1###Theerrormayexistincom/mszlu/blog/mapper/CommentMapper.java(bestguess)###Theerrormayinvolvecom.mszlu.bl
我的实体类:@Entity@Table(catalog="emp",name="person")@XmlAccessorType(XmlAccessType.FIELD)publicclassPersonimplementsSerializable{privatestaticfinallongserialVersionUID=1L;/***/@Column(name="ID",nullable=false,length=50)@Basic(fetch=FetchType.EAGER)@Id@XmlElementStringid;/***/@Column(name="ADDRESS",l
我在使用JavaJDBC和MySQL时遇到了这个错误:com.mysql.jdbc.MysqlDataTruncation:Datatruncation:Datatoolongforcolumn'column_name'我该如何补救这个错误? 最佳答案 当我打算将图像文件作为字节插入数据库时,我在我的SpringBootDataJPA应用程序中遇到了同样的问题-它给了我同样的错误。经过多次研发,我找到了如下解决方案。我在我的application.properties文件中添加了以下行,它解决了这个问题:spring.datas