zoukankan      html  css  js  c++  java
  • 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);
    	}
    
  • 相关阅读:
    exe4j的使用
    java线程生命周期及其对应方法
    自动登录开心网
    java小知识点
    java工具类目录
    java 上传图片
    eclipse+svn
    maven
    读propert文件
    hadoop学习
  • 原文地址:https://www.cnblogs.com/ouysq/p/4536881.html
Copyright © 2011-2022 走看看