@Override
	public List<Product> findAllProductsByShop(Shop shop) throws BusinessException {
		List<Product> products=new ArrayList<Product>();
		Connection connection=null;
		Statement statement=null;
		ResultSet resultSet=null;
		try {
			connection=dataSource.getConnection();
			String sql= "SELECT * FROM products WHERE shop_id='"+shop.getId()+"'";
			statement=connection.createStatement();
			resultSet=statement.executeQuery(sql);
			while (resultSet.next()) {
				Integer productId= resultSet.getInt("product_id");
				String name=resultSet.getString("name");
				double price=resultSet.getDouble("price");
				String description=resultSet.getString("description");
				boolean sold=(resultSet.getString("sold").equals("true"))?true:false;
		        Date publishedOn=resultSet.getDate("published_on");
			    Date updatedOn=resultSet.getDate("update_on");
				int visitedCount=resultSet.getInt("visited_count");
				String imageURI=resultSet.getString("image_uri");
				Category category=new Category(resultSet.getInt("category_id"));
				Product product=new Product(productId, shop, category, name, price, description, sold, publishedOn, updatedOn, visitedCount, imageURI);
				products.add(product);
			}
		}  catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			throw new BusinessException();
		} finally {
			if (resultSet != null) {
				try {
					resultSet.close();
				} catch (SQLException e) {
				}
			}
			if (statement != null) {
				try {
					statement.close();
				} catch (SQLException e) {
				}
			}
			if (connection != null) {
				try {
					connection.close();
				} catch (SQLException e) {
				}
			}
		}
		return products;
	}