java.sql.SQLException:字段“supplier_id”没有默认值
我收到一条错误消息:
java.sql.SQLException: Field 'supplier_id' doesn't have a default value
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1402)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1317)
每个人都可以帮助我吗?我的数据库字段不为空。但我想得到这个结果:
insert into xxx(name,password)values('xxx','xxx');
和两者的成功(在客户端中都是成功的,但在java代码中是错误的,错误代码在顶部标题),而不是假的;mysql jar is mysql-connector-java-5.0.8insert into xxx(name,password,man)values('xxx','xxx','xxx');
insert into xxx(name,password)values('xxx','xxx')