try (DbConnection connection = DbConnectionPool.INSTANCE.getConnection();
PreparedStatement categoryStatement = connection.prepareStatement(SQL_CATEGORY_BY_DEPARTMENT);
PreparedStatement departmentStatement = connection.prepareStatement(SQL_FIND_ALL)) {
ResultSet resultSet = departmentStatement.executeQuery();
while (resultSet.next()) {
Department department = new Department();
fillUpDepartment(resultSet, department);
categoryStatement.setInt(1, department.getUid());
ResultSet categoriesResultSet = categoryStatement.executeQuery();
setDepartmentCategories(categoriesResultSet, department);
departments.add(department);
}