src/main/java/com/qa/IMS/persistence/dao/ItemDAO.java
@Override
	public Item create(Item item) {
		try (Connection connection = DBUtils.getInstance().getConnection();
				Statement statement = connection.createStatement();) {
			statement.executeUpdate("INSERT INTO product(name, model, stock, price) values('" + item.getName()
					+ "','" + item.getModel() + "','" + item.getStock() + "','" + item.getPrice() + "')");
			return readLatest();
		} catch (Exception e) {
			
			LOGGER.info(e.getMessage());
		}
		return null;
	}
/**
	 * Creates a customer in the database
	 * 
	 * @param customer - takes in a customer object. id will be ignored
	 */
Creates a customer in the database

@param customer - takes in a customer object. id will be ignored
Creates a customer in the database @param customer - takes in a customer object . id will be ignored
@Override
	public Item create(Item item) {
		try (Connection connection = DBUtils.getInstance().getConnection();
				Statement statement = connection.createStatement();) {
			statement.executeUpdate("INSERT INTO product(name, model, stock, price) values('" + item.getName()
					+ "','" + item.getModel() + "','" + item.getStock() + "','" + item.getPrice() + "')");
			return readLatest();
		} catch (Exception e) {
			LOGGER.info(e.getMessage());
		}
		return null;
	}
@ Override public Item create ( Item item ) { try ( Connection connection = DBUtils . getInstance ( ) . getConnection ( ) ; Statement statement = connection . createStatement ( ) ; ) { statement . executeUpdate ( "INSERT INTO product(name, model, stock, price) values('" + item . getName ( ) + "','" + item . getModel ( ) + "','" + item . getStock ( ) + "','" + item . getPrice ( ) + "')" ) ; return readLatest ( ) ; } catch ( Exception e ) { LOGGER . info ( e . getMessage ( ) ) ; } return null ; }
Creates a customer in the database
Creates a customer in the database