code: public List<CmsProject> readProjectsForResource(CmsDbContext dbc, String rootPath) throws CmsDataAccessException {
  
          PreparedStatement stmt = null;
          List<CmsProject> projects = new ArrayList<CmsProject>();
          ResultSet res = null;
          Connection conn = null;
  
          try {
              conn = m_sqlManager.getConnection(dbc);
              stmt = m_sqlManager.getPreparedStatement(conn, "C_PROJECTS_READ_BYRESOURCE_1");
  
              stmt.setString(1, rootPath + "%");
              res = stmt.executeQuery();
  
              if (res.next()) {
                  projects.add(internalCreateProject(res));
                  while (res.next()) {
                      // do nothing only move through all rows because of mssql odbc driver
                  }
              }
          } catch (SQLException e) {
              throw new CmsDbSqlException(
                  Messages.get().container(Messages.ERR_GENERIC_SQL_1, CmsDbSqlException.getErrorQuery(stmt)),
                  e);
          } finally {
              m_sqlManager.closeAll(dbc, conn, stmt, res);
          }
  
          return projects;
      }
docs: Returns the projects of a given resource.<p>
  
  @param dbc the database context
  @param rootPath the resource root path
  
  @return the projects of the resource, as a list of projects
  
  @throws CmsDataAccessException if something goes wrong