In the om classes there is a method getFieldNames().
So for table FOO, Foo.getFieldNames();

john mcnally

John Colvin wrote:
> 
> Hi
> I have method below that extracts the columns of a table, is there anyway
> that the columns can come out of tbMap.getColumns() in the same order as
> 'DESCRIBE tablename' does in mysql. I am creating a dynamic data dumper that
> will dump out column headings with all rows below in an html table,
> unfortunately with the getColumns() method I do not know which order to
> print out my Peer data when it is returned.
> 
> Or can anybody suggest another method of retrieving the column names?
> 
> /** Returns a Vector of the column names in a table
> */
>     private Vector getColumnNames( MapBuilder mapBuilder, String name ){
> 
>      Vector columnNames =  new Vector();
>      DatabaseMap dbMap =  mapBuilder.getDatabaseMap();
> 
>      TableMap tbMap = dbMap.getTable(name);
> 
>      ColumnMap[] cMaps = tbMap.getColumns();
> 
>      for(int i = 0; i < cMaps.length; i++)
>      {
>           columnNames.add(cMaps[i].getColumnName());
>         }
> 
>      return columnNames;
>     }
> 
> Thanks in advance.
> 
> John Colvin
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.263 / Virus Database: 135 - Release Date: 6/24/2001
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to