Cause: java.sql.SQLException: Column count doesn't match value count at row 1

来源:互联网 发布:mac安装office2016激活 编辑:程序博客网 时间:2024/05/16 18:18

异常:Cause: java.sql.SQLException: Column count doesn't match value count at row 1

原因:sql异常,字段列与值列数目或类型不匹配导致。

出现:mapper配置文件中,sql编写错误。

解决:核查sql,排除。

出错SQL:

  

      INSERT INTO delivery_mail_log        (customer_id,mail_type,mail_title,mail_content,send_time,message,status,yn,ts,create_time,create_pin,update_pin)        VALUES (        #{customerId,jdbcType=BIGINT},#{mailType,jdbcType=VARCHAR},#{mailTitle,jdbcType=VARCHAR},        #{mailContent,jdbcType=VARCHAR},#{sendTime,jdbcType=TIMESTAMP},#{message,jdbcType=VARCHAR},        #{status,jdbcType=INTEGER},now(),now(),'system','system'        )

修改SQL:

      INSERT INTO delivery_mail_log        (customer_id,mail_type,mail_title,mail_content,send_time,message,status,yn,ts,create_time,create_pin,update_pin)        VALUES (        #{customerId,jdbcType=BIGINT},#{mailType,jdbcType=VARCHAR},#{mailTitle,jdbcType=VARCHAR},        #{mailContent,jdbcType=VARCHAR},#{sendTime,jdbcType=TIMESTAMP},#{message,jdbcType=VARCHAR},        #{status,jdbcType=INTEGER},0,now(),now(),'system','system'        )


0 0
原创粉丝点击