public void save(ProductBean product, List<String> list) {
        String sql = "  insert into product (name,price) values (?,?) ";
        DBUtil util = new DBUtil();
        Connection conn = util.getConnection();
        try {
	conn.setAutoCommit(false);
    } catch (SQLException e2) {
	e2.printStackTrace();
    }
        try {
			PreparedStatement pstmt = conn.prepareStatement(sql);
			pstmt.setString(1,product.getName());
			pstmt.setFloat(2,product.getPrice());
			pstmt.executeUpdate();
			conn.commit();
		
                
                   int product_id = this.getProductIdByName(product.getName());
            for(int i = 0;i<list.size();i++ ){
                String sql3 = " insert into product_item (product_id,item_id) values (?,?)";
                int item_id = Integer.parseInt(list.get(i));
             try {
                PreparedStatement pstmt2 = conn.prepareStatement(sql3);
                pstmt2.setInt(1,product_id);
                pstmt2.setInt(2, item_id);
                pstmt2.executeUpdate();
                conn.commit();
                
            } catch (SQLException ex) {
                   ex.printStackTrace();
                    try {
                        conn.rollback();
                    } catch (SQLException ex1) {
                        ex1.printStackTrace();
                    } 
                                                                  
                }
            }
            } catch (SQLException e) {
			e.printStackTrace();
			try {
				conn.rollback();
			} catch (SQLException e1) {
				e1.printStackTrace();
			}
                }
        util.closeConnection(conn);
       
    }