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

时间:2015-05-28 21:24:44   收藏:0   阅读:937

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);
	}

 

原文:http://www.cnblogs.com/ouysq/p/4536881.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!