public Collection<String> listColumns(String table) throws DatabaseException {
  Collection<String> result=new ArrayList<String>();
  ResultSet rs=null;
  try {
    DatabaseMetaData dbm=connection.getMetaData();
    rs=dbm.getColumns(null,null,table,null);
    while (rs.next()) {
      result.add(rs.getString("COLUMN_NAME"));
    }
  }
 catch (  SQLException e) {
    throw new DatabaseException(e);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
      }
    }
  }
  return result;
}

public Collection < String > listColumns ( String table ) throws DatabaseException { Collection < String > result = new ArrayList < String > ( ) ; ResultSet rs = null ; try { DatabaseMetaData dbm = connection . getMetaData ( ) ; rs = dbm . getColumns ( null , null , table , null ) ; while ( rs . next ( ) ) { result . add ( rs . getString ( "COLUMN_NAME" ) ) ; } } catch ( SQLException e ) { throw new DatabaseException ( e ) ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } } return result ; }
get a list of all of the columns on a table .
