@Override
	public List<Product> getProductsLessThenXInStock(int stock) throws StorageException {
		ResultSet rs = null;
	    Connection conn = null;
	    PreparedStatement pstmt = null;
	    products.clear();
	    
	    try {
			conn = Database.getConnection();
			
			String query = "SELECT products.id, products.product_name, products.description, "
								+ "products.cost, products.rrp "
						 + "FROM products "
						 + "INNER JOIN warehouse "
						 + "ON products.id = warehouse.products_id "
						 + "WHERE warehouse.stock < ?;";
		
			pstmt = conn.prepareStatement(query);
			
			pstmt.setInt(1, stock);
			
			rs = pstmt.executeQuery();
			
			// Display all the data in the table.
			while (rs.next()) {
				Product tempProduct = new Product(rs.getInt("id"));
				tempProduct.setProductName(rs.getString("product_name"));
				tempProduct.setDescription(rs.getString("description"));
				tempProduct.setCost(rs.getDouble("cost"));
				tempProduct.setRrp(rs.getDouble("rrp"));
				
				products.add(tempProduct);
	        }
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
			throw new StorageException(e.getMessage());
		} catch (SQLException e) {
			e.printStackTrace();
			throw new StorageException(e.getMessage());
		} finally {
			try {
				if(rs != null) {
					rs.close();
				}
				if(pstmt != null) {
					pstmt.close();
				}
				if(conn != null) {
					conn.close();
				}
			} catch (SQLException e) {
				e.printStackTrace();
				throw new StorageException(e.getMessage());
			}
		}
	    
	    return products;
	}