code: @SuppressWarnings("resource")
      private CmsSqlConsoleResults executeQuery(String sentence, String poolName) throws SQLException {
  
          Connection conn = null;
          PreparedStatement stmt = null;
          ResultSet res = null;
  
          CmsSqlManager sqlManager = m_sqlManager;
  
          try {
              conn = sqlManager.getConnection(poolName);
              stmt = sqlManager.getPreparedStatementForSql(conn, sentence);
              res = stmt.executeQuery();
  
              // add headings
              ResultSetMetaData metadata = res.getMetaData();
              List<String> heading = new ArrayList<>();
              for (int i = 0; i < metadata.getColumnCount(); i++) {
                  heading.add(metadata.getColumnName(i + 1));
              }
              List<List<Object>> data = new ArrayList<List<Object>>();
  
              // add contents
              while (res.next()) {
                  List<Object> row = new ArrayList<Object>();
                  for (int i = 0; i < metadata.getColumnCount(); i++) {
                      Object value = res.getObject(i + 1);
                      if ((value instanceof String)
                          || (value instanceof Integer)
                          || (value instanceof Long)
                          || (value instanceof Float)
                          || (value instanceof Double)) {
                          row.add(value);
                      } else if (value == null) {
                          row.add(null);
                      } else {
                          row.add(String.valueOf(value));
                      }
                  }
                  data.add(row);
              }
              return new CmsSqlConsoleResults(heading, data);
          } finally {
              sqlManager.closeAll(null, conn, stmt, res);
          }
      }
docs: Executes a single <code>SELECT</code> sql sentence.<p>
  
  @param sentence the sentence to execute
  @param poolName the name of the pool to use
  
  @return the list of rows returned by the rdbms
  
  @throws SQLException in the case of a error