Get the field column headings in HTML.
@param out The html out stream.
@exception DBException File exception.
17272
public void printHtmlHeading(PrintWriter out)
    {
        if (this.getScreenField().getConverter() != null)
            super.printHtmlHeading(out);
        else if (this.getScreenField().getParentScreen() instanceof GridScreen)
        { // These are command buttons such as "Form" or "Detail"
            String strImage = "Form";
            if (((SButtonBox)this.getScreenField()).getImageButtonName() != null)
                strImage = ((SButtonBox)this.getScreenField()).getImageButtonName();
            out.println("<th align=\"center\" valign=\"center\"><img src=\"" + HtmlConstants.IMAGE_DIR + "buttons/" + strImage + ".gif\" width=\"16\" height=\"16\" alt=\"Open this record\"></th>");
        }
    }
535098
public String getStr(String field, Charset charset) {
		final Object obj = get(field);
		if (obj instanceof Clob) {
			return SqlUtil.clobToStr((Clob) obj);
		} else if (obj instanceof Blob) {
			return SqlUtil.blobToStr((Blob) obj, charset);
		} else if (obj instanceof RowId) {
			final RowId rowId = (RowId) obj;
			return StrUtil.str(rowId.getBytes(), charset);
		}
		return super.getStr(field);
	}
911491
public void writeHtmlHead(Writer out)
         throws IOException
    {
        if (!writtenHtmlHead)
        {
            writtenHtmlHead=true;
            completeSections();
            out.write("<html><head>");
            String title=(String)properties.get(Title);
            if (title!=null && title.length()>0 && !title.equals(NoTitle))
                out.write("<title>"+title+"</title>");
            head.write(out);
            out.write(base);
            out.write("\n</head>\n");
        }
    }
1182449
public int dataToField(Field field) throws DBException
    {
        return ((BaseBuffer)this.getDataSource()).getNextField((FieldInfo)field, Constants.DISPLAY, Constants.READ_MOVE);
    }
823373
@Override public final String getHeaderField(String fieldName) {
    try {
      return fieldName == null
          ? StatusLine.get(getResponse().getResponse()).toString()
          : getHeaders().get(fieldName);
    } catch (IOException e) {
      return null;
    }
  }
1003923
public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException
    {
        if (this.isNull())
        {
            if ((this.isNullable()) && (iType != DBConstants.SQL_SELECT_TYPE))
                statement.setNull(iParamColumn, Types.DOUBLE);
            else
                statement.setDouble(iParamColumn, Double.NaN);
        }
        else
            statement.setDouble(iParamColumn, this.getValue());
    }
1070761
public Content getSerializableFields(String heading, Content serializableFieldsTree) {
        HtmlTree li = new HtmlTree(HtmlTag.LI);
        li.addStyle(HtmlStyle.blockList);
        if (serializableFieldsTree.isValid()) {
            Content headingContent = new StringContent(heading);
            Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
                    headingContent);
            li.addContent(serialHeading);
            li.addContent(serializableFieldsTree);
        }
        return li;
    }
454944
public SQLXML getSQLXML(int columnIndex) throws SQLException {
        try {
            SQLXML xml = rsetImpl.getSQLXML(columnIndex); 
            if (xml != null && freeResourcesOnClose)
                xmls.add(xml); 
            return xml; 
        } catch (SQLException sqlX) {
            FFDCFilter.processException(
                                        sqlX, getClass().getName() + ".getSQLXML", "2115", this);
            throw WSJdbcUtil.mapException(this, sqlX);
        } catch (NullPointerException nullX) {
            // No FFDC code needed; we might be closed.
            throw runtimeXIfNotClosed(nullX);
        } catch (AbstractMethodError methError) {
            // No FFDC code needed; wrong JDBC level.
            throw AdapterUtil.notSupportedX("ResultSet.getSQLXML", methError);
        } catch (RuntimeException runX) {
            FFDCFilter.processException(
                                        runX, getClass().getName() + ".getSQLXML", "2131", this);
            if (tc.isDebugEnabled())
                Tr.debug(this, tc, "getSQLXML", runX);
            throw runX;
        } catch (Error err) {
            FFDCFilter.processException(
                                        err, getClass().getName() + ".getSQLXML", "2138", this);
            if (tc.isDebugEnabled())
                Tr.debug(this, tc, "getSQLXML", err);
            throw err;
        }
    }
1186236
List<ColumnMetadata> getFieldMetaData() {
        return columnsMetadata.entrySet()
                              .stream()
                              .map(entry -> entry.getValue())
                              .collect(Collectors.toList());
    }
1120120
protected void writeFieldResultContent(final OutputStream out) throws IOException 
    {
    	document.filterSpecialChar(out, defaultText, true, true);
    }
1281934
public static List<String> getFieldNames(ResultSetMetaData  resultSetMetaData) throws SQLException {
        List<String> columnNames = new ArrayList<>();
        int cols = resultSetMetaData.getColumnCount();
        for (int i = 1; i <= cols; i++) {
            columnNames.add(resultSetMetaData.getColumnName(i));
        }
        return columnNames;
    }
8420
public void write(Writer out)
         throws IOException
    {
        writeHtmlHead(out);
        writeBodyTag(out);
        writeElements(out);
        writeHtmlEnd(out);
    }
1247539
protected void encodeColHeaders(final FacesContext context, final Sheet sheet, final WidgetBuilder wb)
                throws IOException {
        final JavascriptVarBuilder vb = new JavascriptVarBuilder(null, false);
        for (final SheetColumn column : sheet.getColumns()) {
            if (!column.isRendered()) {
                continue;
            }
            vb.appendArrayValue(column.getHeaderText(), true);
        }
        wb.nativeAttr("colHeaders", vb.closeVar().toString());
    }
1110524
public String[] getColumnsBySql(Sql sql) throws SQLException {
		String columns[] = null;
		
		List<Map<String, String>> table = getMetadataBySql(sql);
		if (table != null) {
			columns = new String[table.size()];
			for (int i = 0 ; i < table.size() ; i++) {
				Map<String, String> row = table.get(i);
				if (row.containsKey("NAME") && row.get("NAME") != null) {
					columns[i] = row.get("NAME");
				}
			}
		}
		
		return columns;
	}
765691
public void doOpen() throws DBException
    {
        try   {
    // FROM is automatic, since the remote BaseRecord is exactly the same as this one
    // ORDER BY
            KeyArea keyArea = this.getRecord().getKeyArea(-1);  // Current index
            String strKeyArea = null;
            boolean bDirection = DBConstants.ASCENDING;
            if (true)
            {
                strKeyArea = keyArea.getKeyName();
                bDirection = keyArea.getKeyField(DBConstants.MAIN_KEY_FIELD).getKeyOrder();
            }
            m_bDirectionCurrent = bDirection;
    // Open mode
            int iOpenMode = this.getRecord().getOpenMode();
    // SELECT (fields to select)
            String strFields = null;
            if (true) // All selected?
            {
                strFields = this.getRecord().getSQLFields(DBConstants.SQL_SELECT_TYPE, true);
                if (strFields.equals(" *"))
                    strFields = null; // Select all
            }
    // WHERE XYZ >=
            Object objInitialKey = null;
            if (true)
            {
                BaseBuffer buffer = new VectorBuffer(null);
                this.getRecord().handleInitialKey();
                if (keyArea.isModified(DBConstants.START_SELECT_KEY))
                {   // Anything set?
                    keyArea.setupKeyBuffer(buffer, DBConstants.START_SELECT_KEY, false);
                    objInitialKey = buffer.getPhysicalData();
                    buffer.addNextString(Integer.toString(keyArea.lastModified(DBConstants.START_SELECT_KEY, false))); // Largest modified field.
                }
            }
    // WHERE XYZ <=
            Object objEndKey = null;
            if (true)
            {
                BaseBuffer buffer = new VectorBuffer(null);
                this.getRecord().handleEndKey();
                if (keyArea.isModified(DBConstants.END_SELECT_KEY))
                {   // Anything set?
                    keyArea.setupKeyBuffer(buffer, DBConstants.END_SELECT_KEY, false);
                    objEndKey = buffer.getPhysicalData();
                    buffer.addNextString(Integer.toString(keyArea.lastModified(DBConstants.END_SELECT_KEY, false))); // Largest modified field.
                }
            }
    // WHERE XYZ
            byte[] byBehaviorData = null;
            boolean bDirty = false;
            if (this.getRecord().getListener() != null)
            {
                ByteArrayOutputStream baOut = new ByteArrayOutputStream();
                ObjectOutputStream daOut = new ObjectOutputStream(baOut);
                FileListener listener = (FileListener)this.getRecord().getListener();
                while (listener != null)
                {
                    if ((listener.getMasterSlaveFlag() & FileListener.RUN_IN_SLAVE) != 0) // Should exist in a SERVER environment
                        if ((listener.getMasterSlaveFlag() & FileListener.DONT_REPLICATE_TO_SLAVE) == 0) // Yes, replicate to the SERVER environment
                            if (listener.isEnabledListener()) // Yes, only replicate enabled listeners.
                    { // There should be a copy of this on the server
                        bDirty = true;
                        daOut.writeUTF(listener.getClass().getName());
                        listener.initRemoteStub(daOut);
                    }
                    listener = (FileListener)listener.getNextListener();
                }
                daOut.flush();
                if (bDirty)
                    byBehaviorData = baOut.toByteArray();
                daOut.close();
                baOut.close();
            }

            this.checkCacheMode(Boolean.TRUE);      // Make sure the cache is set up correctly for this type of query (typically needed)

            synchronized (this.getSyncObject())
            {   // In case this is called from another task
                m_tableRemote.open(strKeyArea, iOpenMode, bDirection, strFields, objInitialKey, objEndKey, byBehaviorData);
            }
        } catch (Exception ex) {
            throw DatabaseException.toDatabaseException(ex);
        }
    }
610866
public Collection<String> listColumns(String table) throws SQLException {
	Collection<String> result = new ArrayList<String>();
	DatabaseMetaData dbm = connection.getMetaData();
	ResultSet rs = dbm.getColumns(null, null, table, null);
	while (rs.next()) {
	    result.add(rs.getString("COLUMN_NAME"));
	}
	return result;
    }
621651
public StringArray getHeadings() {
    if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_headings == null)
      jcasType.jcas.throwFeatMissing("headings", "ch.epfl.bbp.uima.types.DataTable");
    return (StringArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).casFeatCode_headings)));}