public List<Item> findItemsBySearch(String query) throws Exception {
    if (itemsBySearch == null) itemsBySearch = connection.prepareStatement(
      "SELECT * FROM ITEMS I1 INNER JOIN ITEMLIVRES L ON L.ITEM = I1.ID WHERE LOWER(I1.TITRE) LIKE '%' || LOWER(?) || '%' UNION " +
      "SELECT * FROM ITEMS I2 INNER JOIN ITEMDVDS M ON M.ITEM = I2.ID WHERE LOWER(I2.TITRE) LIKE '%' || LOWER(?) || '%' UNION " +
      "SELECT * FROM ITEMS I3 INNER JOIN ITEMDISQUES A ON A.ITEM = I3.ID WHERE LOWER(I3.TITRE) LIKE '%' || LOWER(?) || '%'"
    );
    query = query.replaceAll("\\s+", "%");
    itemsBySearch.setString(1, query);
    itemsBySearch.setString(2, query);
    itemsBySearch.setString(3, query);
    ResultSet rs = itemsBySearch.executeQuery();
    List<Item> items = new ArrayList<Item>();
    while (rs.next()) {
      int type = rs.getInt(2);
      if (type == 1) {
        items.add(new AlbumItem(rs));
      } else if (type == 2) {
        items.add(new MovieItem(rs));
      } else if (type == 3) {
        items.add(new BookItem(rs));
      } else {
        items.add(new Item(rs));
      }
    }
    return items;
  }