首页 > 解决方案 > Java 注册表单:com.mysql.cj.jdbc.exceptions.MysqlDataTruncation:数据截断:第 1 行的“图片”列数据太长

问题描述

我在java NetBeans中处理SignupForm,我想在这个Form中添加一张图片,我创建了jbanel_pic来在Form之前显示图片创建帐户并将这个数据发送到Mysql Server数据库结构上,我创建了一个类Myfunc激活 jBottunbrowse 并从我的电脑中选择图片。当我单击Create Bottun在此处输入代码时,数据未发送到 Mysql 服务器并出现此错误:

Oct 09, 2021 9:42:19 PM SignupFrame Button_CreateActionPerformed
SEVERE: null
com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column 'picture' at row 1
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1040)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1350)

标签: pythonjavamysqlmysql-connector

解决方案


推荐阅读