The following example shows you how get the number of columns used in the query for the DownloadTableData instance.
import java.sql.ResultSetMetaData;
// The method used to return the number of columns in a DownloadTableData instance query
public int getNumColumns(DownloadTableData td) {
ResultSetMetaData rsmd = td.getMetaData();
return rsmd.getColumnCount();
}