@Override
	public List<Book> getAllBooks() throws StorageException {
		ResultSet rs = null;
	    Connection conn = null;
	    PreparedStatement pstmt = null;
	    books.clear();
	    
	    try {
			conn = Database.getConnection();
			
			String query = "SELECT books.id as book_id, products.id as product_id, "
								+ "products.product_name, products.description, "
								+ "products.cost, products.rrp, books.isbn, books.published "
						 + "FROM products, books "
						 + "WHERE products.id = books.products_id;";
		
			pstmt = conn.prepareStatement(query);
			
			rs = pstmt.executeQuery();
			
			// Display all the data in the table.
			while (rs.next()) {
				Book tempBook = new Book(rs.getInt("book_id"), rs.getInt("product_id"));
				tempBook.setProductName(rs.getString("product_name"));
				tempBook.setDescription(rs.getString("description"));
				tempBook.setCost(rs.getDouble("cost"));
				tempBook.setRrp(rs.getDouble("rrp"));
				tempBook.setIsbn(rs.getString("isbn"));
				tempBook.setPublished(rs.getString("published"));
				
				books.add(tempBook);
	        }
		} 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 books;
	}