Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘businessName‘ cannot be null
Error updating database.Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘businessName’ cannot be nullThe error may exist in OpBusinessMapper.xmlThe error may involve BusinessMapper.in
Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘businessName’ cannot be null
The error may exist in OpBusinessMapper.xml
The error may involve BusinessMapper.insertBusi-Inline
The error occurred while setting parameters
SQL: insert into business(businessName, businessAddress, businessExplain, businessImg, orderTypeId, starPrice, deliveryPrice, remarks, password) values (?,?,?,?,?,?,?,?,?)
Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘businessName’ cannot be null
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:180)
at TestBusiness.main(TestBusiness.java:43)
Caused by: java.sql.SQLIntegrityConstraintViolationException: Column ‘businessName’ cannot be null
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:970)
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:387)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
… 3 more
Process finished with exit code 1
错误代码:
修改后的代码:
总结:
增删改查操作中涉及给值的一定要给值
更多推荐
所有评论(0)