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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM