Good Evening,
I am in the midst of a project and have come across two delima's. Currently have a project in which I have to enumerate thru an external source. I have everything written to download to a file but now need to find a way to do two things for which I am at a loss. First one is to parse results from the enumeration to only include part of the result string and second is to send the results to a database. I have the database connection aspect figured out just now how to get the results to go to it.
AccountName field value is formatted like number "Space" name and I just need to get the number value and remove the name. Database is a SQL Database. Any help would be so appreciative.
Excerpt of the code with the enumeration.
Code:
@SuppressWarnings("rawtypes")
Enumeration enumReportFields = generalQuery.getAvailableReportFields();
ReportFieldSet fieldSet = generalQuery.getReportFieldSet();
while(enumReportFields.hasMoreElements()) {
ReportField reportField = (ReportField) enumReportFields.nextElement();
if(reportField.getFieldName().equals("AccountName"))
fieldSet.addField(reportField);
}
ReportMetricSet reportMetricSet = generalQuery.getReportMetricSet();
@SuppressWarnings("rawtypes")
Enumeration enumReportMetrics = generalQuery.getAvailableReportMetrics();
while(enumReportMetrics.hasMoreElements()) {
ReportMetric reportMetric = ((ReportMetric)enumReportMetrics.nextElement());
if(reportMetric.getMetricName().equals("Value1")
|| reportMetric.getMetricName().equals("value2"))
reportMetricSet.addMetric(reportMetric);
}
As of this moment the results are going to a file via an inputstream/fileoutputstream.