public void add(OrderBean order, List<String>  products,  List<Integer> quaList) {
        List<Integer> productsOld = this.getProductsByOrderId(order.getId());
        List<Integer> productsNew = new ArrayList<Integer>();
        for(int i=0;i<products.size();i++ ){
                int num = Integer.parseInt(products.get(i));
                productsNew.add(num);
            }            
        for(int j=0; j<productsNew.size();j++){
            if(productsOld.contains(productsNew.get(j))){
                int quantityOld = this.getQuantity(order.getId(), productsNew.get(j));
                int quantityNew = quaList.get(j)+quantityOld;
                 String sql = " update order_product set quantity = ? where order_id = ? and product_id = ? ";
                 DBUtil util = new DBUtil();
                 Connection conn = util.getConnection();
                  try {
	conn.setAutoCommit(false);
                    } catch (SQLException e2) {
	e2.printStackTrace();
                   }
                 try {
	PreparedStatement pstmt = conn.prepareStatement(sql);
	pstmt.setInt(1,quantityNew);
	pstmt.setInt(2,order.getId());
                          pstmt.setInt(3,productsNew.get(j));
	pstmt.executeUpdate();
	conn.commit();  
                      }catch (SQLException ex) {
                   ex.printStackTrace();
                    try {
                        conn.rollback();
                    } catch (SQLException ex1) {
                        ex1.printStackTrace();
                    } 
                                                                  
                }
        }else{
                String sql1 = " insert into order_product (order_id,product_id,quantity) values (?,?,?)";
                DBUtil util = new DBUtil();
                Connection conn = util.getConnection();
                try {
	conn.setAutoCommit(false);
                    } catch (SQLException e2) {
	e2.printStackTrace();
                   }
                 try{
                 PreparedStatement pstmt1 = conn.prepareStatement(sql1);
                 pstmt1.setInt(1, order.getId());
                 pstmt1.setInt(2, productsNew.get(j));
                 pstmt1.setInt(3, quaList.get(j));
                 pstmt1.executeUpdate();
                conn.commit();
            }catch (SQLException ex) {
                   ex.printStackTrace();
                    try {
                        conn.rollback();
                    } catch (SQLException ex1) {
                        ex1.printStackTrace();
                    } 
                                                                  
                }
        
          }
        }
    }