com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'goodsName' cannot be null

com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column ‘goodsName‘ cannot be null

出现这错误,是我封装页面的时候出现的错误。

	private void addGoods(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		  // 1.封装页面的数据
				FromGoods bean = WebUtils.fillFormBean(request, FromGoods.class);
				// 3.创建Goods对象,并拷贝formbean的数据
				Goods u = new Goods();
				try {
					BeanUtils.copyProperties(u, bean);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				// 4.调用service层完成添加的操作
				gs.add(u);
						// 5.重新计算总页面等等
				getAllGoods(request, response);
	}

com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'goodsName' cannot be null

时间: 2024-11-06 20:45:02

com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'goodsName' cannot be null的相关文章

Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'username' cannot be null

今天程序中遇见这个错误一直找不到哪里错后来重写了一遍jsp页面才知道 username我写成了name 和po中的代码对应不上导致了这个错误 写代码一定要认真一点啊     好坑啊 Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'username' cannot be null

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'org_mer_id' in where clause is ambiguous

### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'org_mer_id' in where clause is ambiguous ### The error may exist in class path resource [mapper/StatisticsPeriodTaskMapper.xml] ##

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 't.statis_date'

1.错误原因 [ERROR:]2015-04-18 13:20:31,883 [异常拦截] com.skycloud.oa.exception.ExceptionHandler org.hibernate.exception.SQLGrammarException: error executing work at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.j

jdbc连接mysql报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'é?‘å?‰æ—­' in 'field list'

解决了中文显示乱码问题之后,又出现了这么一个问题, 思考一下,这绝对是输入文本的问题. 试了一下,果然不出所料. 再次怀疑编码,没有办法, 只有很无奈地去百度了,结果是与编码没有问题啊. sql.execute("insert into reader values('"+rn+"','"+pid+"','"+tele+"','"+kno+"')"); 原来报错是因为我没写单引号,mysql当然不认识啊.OK

java.lang.Exception: 资源处理失败,失败原因:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '?????‰' in 'where clause'

1:Unknown column '?????‰' in 'where clause',这个问题,百度一搜,挺多的,但是貌似好像没有解决我的问题.贴一下我是如何拼接sql的.解决这个sql拼接bug的.希望可以帮助到有幸看到的人,谢谢. 1 TbUser.USER_NO.name + " = " + "\'" + userNo + "\'" ; 也许看不懂,哈哈,公司自己封装的,没关系,解决这个错误的关键在于+ "\'" +

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'qingmu' for key 'PRIMARY'

### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'qingmu' for key 'PRIMARY' ### The error may involve com.qingmu2.core.dao.seller.SellerDao.insertSelective-Inline ### The

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: ..... this is incompatible with sql_mode=only_full_group_by

一.异常信息 org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'daotable.

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxError Exception

1.错误描述 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxError Exception:You have an error in your SQL syntax check the manual that corresponds to your MySQL server version for the right syntax to use near 'notnull,user_name varchar(255) )' at line 1 2.错误原因

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL

1.错误描述 org.hibernate.exception.SQLGrammarException: error executing work at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:80) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(