List<Hypermarket> hypermarkets = new ArrayList<>();
try (DbConnection connection = DbConnectionPool.INSTANCE.getConnection();
PreparedStatement statement = connection.prepareStatement(SQL_FIND_ALL)) {
ResultSet resultSet = statement.executeQuery();
while (resultSet.next()) {
Hypermarket hypermarket = new Hypermarket();
fillUpHypermarket(resultSet, hypermarket);
hypermarkets.add(hypermarket);
}
} catch (ConnectionPoolException e) {
log.error("Error during getting connection from the pool", e);