ResultSetMetaData columns = prs.getMetaData();
int colCount = columns.getColumnCount();
Rep("Statement returns "+colCount+" columns");
String wColumns = "";
for(int i=0;i<colCount;i++){
COLUMNTYPE colType = exportInfo.addNewCOLUMNTYPE();
colType.setNAME(columns.getColumnName(i+1));
colType.setTYPE(columns.getColumnTypeName(i+1));
if(columns.getColumnTypeName(i+1).equalsIgnoreCase("DATE")){
colType.setFORMATMASK(DATE_FORMAT);
}
colType.setTABLENAME(columns.getTableName(i+1));
if(i==0){
wColumns = getNewColumn(columns,i+1);
} else {
wColumns = wColumns+","+getNewColumn(columns,i+1);
}