Build a String array of column names from the ResultSet.

@return A String array containing the column names contained within the ResultSet.
@throws SQLException on error
766480
protected String[] getKeysFromResultSet()
            throws SQLException {

        String[] keys = super.getKeysFromResultSet();

        // check schemaProperty mapping names for more accurate column->field mapping
        SchemaProperty[] props = _schemaType.getElementProperties();
        for (int i = 0; i < props.length; i++) {

            int col = -1;
            try {
                col = _resultSet.findColumn(props[i].getName().getLocalPart());
            } catch (SQLException x) {
            }

            if (col > 0) {
                keys[col] = props[i].getJavaPropertyName().toUpperCase();
            }
        }
        return keys;
    }
69136
private String[] buildColumnsArray(List<TColumn> columns) {
		String[] columnsArray = new String[columns.size()];
		for (int i = 0; i < columns.size(); i++) {
			TColumn column = columns.get(i);
			columnsArray[i] = column.getName();
		}
		return columnsArray;
	}
926700
public String buildPreparedStatementName() {
		if (!StringUtils.hasText(preparedStatementName)) {
			preparedStatementName = getParent().buildPreparedStatementName(getName());
		}
		return preparedStatementName;
	}
936816
public String getColumnClassName(int column) throws SQLException
    {
        sourceResultSet.checkColumnBounds(column);
        VoltType type = sourceResultSet.table.getColumnType(column - 1);
        String result = type.getJdbcClass();
        if (result == null) {
            throw SQLError.get(SQLError.TRANSLATION_NOT_FOUND, type);
        }
        return result;
    }
1219201
@Override
    public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException
    {
        assert(procedureNamePattern != null && !procedureNamePattern.isEmpty());
        checkClosed();
        this.sysCatalog.setString(1, "PROCEDURECOLUMNS");
        JDBC4ResultSet res = (JDBC4ResultSet) this.sysCatalog.executeQuery();
        VoltTable vtable = res.getVoltTable().clone(0);

        // Filter the results based on procedure name and column name
        while (res.next()) {
            if (res.getString("PROCEDURE_NAME").equals(procedureNamePattern)) {
                if (columnNamePattern == null || columnNamePattern.equals("%") ||
                    res.getString("COLUMN_NAME").equals(columnNamePattern)) {
                    vtable.addRow(res.getRowData());
                }
            }
        }

        return new JDBC4ResultSet(sysCatalog, vtable);
    }
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;
    }
151357
protected List<String> getColumnNames() {
		List<String> columnNamesList = new ArrayList<>();
		for (int col = 0; col < getTable().getColumnCount(); col++) {
			columnNamesList.add(getTable().getColumnModel().getColumn(col).getHeaderValue().toString());
		}
		return columnNamesList;
	}
883776
public function toSql(): array
    {
        if (!$this->into) {
            throw new SqlException('Undefined INSERT table.');
        }

        if (!$this->columns and !$this->select) {
            throw new SqlException('Undefined INSERT columns.');
        }

        $params = [];

        $sql = ['INSERT INTO', $this->into, '(' . implode(', ', $this->columns) . ')'];

        if ($this->select) {
            $select = $this->prepareSelect($this->select);

            $sql[] = $select['sql'];

            $params = array_merge($params, $select['params']);
        } else {
            $columnsCount = count($this->columns);

            $valuesCount = count($this->values);

            if ($columnsCount !== $valuesCount) {
                throw new SqlException('INSERT values count does not match.'
                    . ' Expected ' . $columnsCount . ', got ' . $valuesCount . '.');
            }

            $sql[] = 'VALUES ' . $this->prepareBindKeys($this->values);

            $params = array_merge($params, $this->values);
        }

        $sql = implode(' ', $sql);

        return [$sql, $params];
    }
1240233
public int[] getIndexOfColumns(Collection<String> columnNames) {
        return getIndexOfColumns(columnNames.toArray(new String[columnNames.size()]));
    }
185509
public static String[] getSelectColumns(String sql) {
		Asserts.notBlank(sql);
		sql = sql.trim();
		if (sql.startsWith("select ") || sql.startsWith("SELECT ")) {
			sql = sql.substring(7).trim();
			int idxFrom = sql.indexOf(" from ");
			if (idxFrom == -1)
				idxFrom = sql.indexOf(" FROM ");
			if (idxFrom == -1)
				throw new IllegalArgumentException("Bad sql, no from ");
			sql = sql.substring(0, idxFrom).trim();
			String[] columns = sql.split(",");
			for (int i = 0; i < columns.length; i++) {
				columns[i] = columns[i].trim();
			}
			return columns;
		} else {
			throw new IllegalArgumentException("Not a select sql");
		}
	}
1253045
public String buildSQL() {
        mTables = new Hashtable();
        mColumns = new Vector();

        String key = null;
        for (Enumeration keys = mPropertiesMap.keys(); keys.hasMoreElements();) {
            key = (String) keys.nextElement();
    
            // Get columns to select
            String column = (String) mPropertiesMap.get(key);
            mColumns.addElement(column);
    
            tableJoins(column, false);
        }

        // All data read, build SQL query string
        return buildSelectClause() + buildFromClause() 
            + buildWhereClause(); 
    }
1265703
@Override
	public String getString(final int columnIndex) throws SQLException {
		String columnLabel = getWrapped().getMetaData().getColumnLabel(columnIndex);

		return getString(columnLabel);
	}
1229236
public List<SchemaName> getSchemas() throws SQLException {
        final List<SchemaName> list = new ArrayList<>();
        try (ResultSet results = databaseMetadata.getSchemas()) {
            if (results != null) {
                bind(results, SchemaName.class, list);
            }
        }
        return list;
    }
78610
public String getColumnName(int column) throws SQLException
    {
        sourceResultSet.checkColumnBounds(column);
        return sourceResultSet.table.getColumnName(column - 1);
    }
514518
public function setToSql(): array
    {
        if (!$this->set) {
            throw new SqlException('Undefined UPDATE SET columns.');
        }

        $sql = $params = [];

        foreach ($this->set as $item) {
            $sqlPart = $item['sql'];

            $item['params'] && $params = array_merge($params, $item['params']);

            $sql[] = $sqlPart;
        }

        $sql = 'SET ' . implode(', ', $sql);

        return [$sql, $params];
    }
1182982
public GeometryColumns queryForTableName(String tableName)
			throws SQLException {
		GeometryColumns geometryColumns = null;
		if (tableName != null) {
			List<GeometryColumns> results = queryForEq(
					GeometryColumns.COLUMN_TABLE_NAME, tableName);
			if (!results.isEmpty()) {
				if (results.size() > 1) {
					throw new SQLException("More than one "
							+ GeometryColumns.class.getSimpleName()
							+ " returned for Table Name: " + tableName);
				}
				geometryColumns = results.get(0);
			}
		}
		return geometryColumns;
	}
147474
public String prepareStatementString() throws SQLException {
		List<ArgumentHolder> argList = new ArrayList<ArgumentHolder>();
		return buildStatementString(argList);
	}