Java 插入数据库问题

    xiaoxiao2021-03-25  123

    错误:

    java.sql.SQLException: Column count doesn't match value count at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2818) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2157) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2460) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2377) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2361)

    一、数的量不一致 数据库记录的要插入的数量要和给的值一致二、类型不匹配

    MySql的 类型有Java中与之对应的类型备注datejava.sql.Date..Datetimejava.sql.Timestamp…Timestampjava.sql.TimestampTimejava.sql.TimeYearjava.sql.Datebit[1]0或者1sql.setInt(0);
    转载请注明原文地址: https://ju.6miu.com/read-10136.html

    最新回复(0)