src/main/java/com/qa/IMS/persistence/dao/ItemDAO.java
@Override
	public Item update(Item item) {
		try (Connection connection = DBUtils.getInstance().getConnection();
				Statement statement = connection.createStatement();) {
			statement.executeUpdate("update product set name ='" + item.getName() + "', model ='"
					+ item.getModel() + "', stock = '" + item.getStock() + "', price = '" + item.getPrice() + "' where item_id =" + item.getProduct_id());
			return readItem(item.getProduct_id());
		} catch (Exception e) {
			
			LOGGER.info(e.getMessage());
		}
		return null;
	}
/**
	 * Updates a customer in the database
	 * 
	 * @param customer - takes in a customer object, the id field will be used to
	 *                 update that customer in the database
	 * @return
	 */
Updates a customer in the database

@param customer - takes in a customer object, the id field will be used to
update that customer in the database
@return
Updates a customer in the database @param customer - takes in a customer object the id field will be used to update that customer in the database @return
@Override
	public Item update(Item item) {
		try (Connection connection = DBUtils.getInstance().getConnection();
				Statement statement = connection.createStatement();) {
			statement.executeUpdate("update product set name ='" + item.getName() + "', model ='"
					+ item.getModel() + "', stock = '" + item.getStock() + "', price = '" + item.getPrice() + "' where item_id =" + item.getProduct_id());
			return readItem(item.getProduct_id());
		} catch (Exception e) {
			LOGGER.info(e.getMessage());
		}
		return null;
	}
@ Override public Item update ( Item item ) { try ( Connection connection = DBUtils . getInstance ( ) . getConnection ( ) ; Statement statement = connection . createStatement ( ) ; ) { statement . executeUpdate ( "update product set name ='" + item . getName ( ) + "', model ='" + item . getModel ( ) + "', stock = '" + item . getStock ( ) + "', price = '" + item . getPrice ( ) + "' where item_id =" + item . getProduct_id ( ) ) ; return readItem ( item . getProduct_id ( ) ) ; } catch ( Exception e ) { LOGGER . info ( e . getMessage ( ) ) ; } return null ; }
Updates a customer in the database
Updates a customer in the database