answer the index of the column named colName in the table tabName
774675
private int getColIndex(String colName, String tabName) {

        int ordPos = 0;

        try {
            if (cConn == null) {
                return -1;
            }

            if (dbmeta == null) {
                dbmeta = cConn.getMetaData();
            }

            ResultSet colList = dbmeta.getColumns(null, null, tabName,
                                                  colName);

            colList.next();

            ordPos = colList.getInt("ORDINAL_POSITION");

            colList.close();
        } catch (SQLException e) {
            System.out.println("SQL Exception: " + e.getMessage());
        }

        return ordPos - 1;
    }
1204516
private Map<String, Table> getIndex(Table table)
   {
      Map<String, Table> result;

      if (!table.getResourceFlag())
      {
         result = m_taskTablesByName;
      }
      else
      {
         result = m_resourceTablesByName;
      }
      return result;
   }
820572
public JKTableColumn getTableColumn(final int col, final boolean visibleIndex) {
		int actualIndex;
		if (visibleIndex) {
			actualIndex = this.visibilityManager.getActualIndexFromVisibleIndex(col);
		} else {
			actualIndex = col;
		}
		return this.tableColumns.get(actualIndex);
	}
1165519
def column( self, name ):
        
        columns = self.columns()
        if ( name in columns ):
            return columns.index(name)
        return -1
713381
public static int columnIndex(CSTable table, String name) {
        for (int i = 1; i <= table.getColumnCount(); i++) {
            if (table.getColumnName(i).equals(name)) {
                return i;
            }
        }
        return -1;
    }
235921
private int getTableIndex(String tableName) {

        int index;

        // System.out.println("begin searching for "+tableName);
        for (index = 0; index < vHoldTableNames.size(); index++) {

            // System.out.println("in getTableIndex searching for "+tableName+", index: "+index);
            if (tableName.equals((String) vHoldTableNames.elementAt(index))) {
                return index;
            }    // end of if (tableName.equals(vHoldTableNames.elementAt(index)))
        }        // end of for (index = 0; index < vHoldTableNames.size(); index ++)

        return -1;
    }
1240233
public int[] getIndexOfColumns(Collection<String> columnNames) {
        return getIndexOfColumns(columnNames.toArray(new String[columnNames.size()]));
    }
833134
def set_col_name(self, index, name):
        
        javabridge.call(self.jobject, "setColName", "(ILjava/lang/String;)V", index, name)
746712
def colindex_by_colname(self, colname):
        
        for i, coldef in enumerate(self):    # iterate each column's definition
            if coldef.name == colname:
                return i
        raise ValueError('No column named "%s" found' % (colname))
1085563
def get_column_index(self, header):
        
        try:
            index = self._column_headers.index(header)
            return index
        except ValueError:
            raise_suppressed(KeyError(("'{}' is not a header for any "
                                       "column").format(header)))
172532
def is_indexed(self):
        
        try:
            return getattr(self.table.cols, self.cname).is_indexed
        except AttributeError:
            False
723177
def column(self):
        
        for i in my_xrange(self._column_query_pos, self.pos):
            if self.text[i] == '\t':
                self._column += self.tab_size
                self._column -= self._column % self.tab_size
            else:
                self._column += 1
        self._column_query_pos = self.pos
        return self._column
853511
private String getIndexesToDrop(CmsSetupDb dbCon, String tablename) {

        List<String> indexes = new ArrayList<String>();
        String tableIndex = readQuery(QUERY_SHOW_INDEX);
        Map<String, String> replacer = new HashMap<String, String>();
        replacer.put(REPLACEMENT_TABLENAME, tablename);
        CmsSetupDBWrapper db = null;
        try {
            db = dbCon.executeSqlStatement(tableIndex, replacer);
            while (db.getResultSet().next()) {
                String index = db.getResultSet().getString(FIELD_INDEX);
                if (!indexes.contains(index)) {
                    indexes.add(index);
                }
            }

        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            if (db != null) {
                db.close();
            }
        }

        StringBuffer dropIndex = new StringBuffer();
        for (Iterator<String> it = indexes.iterator(); it.hasNext();) {
            String index = it.next();
            if (index.equals(PRIMARY_KEY)) {
                dropIndex.append("DROP PRIMARY KEY, ");
            } else {
                dropIndex.append("DROP INDEX ");
                dropIndex.append(index);
                dropIndex.append(", ");
            }
        }
        return dropIndex.toString();
    }
916959
public String getColumnTypeName( int index ) throws OdaException
	{
        int nativeTypeCode = getColumnType( index );
        return Driver.getNativeDataTypeName( nativeTypeCode );
	}
439433
private int viewIndexForColumn(TableColumn aColumn) {
        TableColumnModel cm = table.getColumnModel();

        for (int column = 0; column < cm.getColumnCount(); column++) {
            if (cm.getColumn(column) == aColumn) {
                return column;
            }
        }

        return -1;
    }
859910
def _column_width(self, index=None, name=None, max_width=300, **kwargs):
        
        assert name is not None or index is not None
        if name and name not in self._column_index:
            return min(max_width, name)

        if index is not None:
            name = self.columns[index]
        else:
            index = self._column_index[name]

        values_width = [len(name)]
        if isinstance(self._parameters.get(name, None), list):
            values_width += [len(self._safe_str(p, **kwargs))
                             for p in self._parameters[name]]

        values_width += [len(self._safe_str(row[index], **kwargs))
                         for row in self.table]

        ret = max(values_width)
        return min(max_width, ret) if max_width else ret
603640
def getInstNameByIndex(self, colId, *indices):
        """"""
        return self.name + (colId,) + self.getInstIdFromIndices(*indices)