bug fixed (updated the output result displayed from the statistical) in DatabaseManagement class related to the bug fixed yesterday.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-access/DatabasesResourcesManager@98872 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Loredana Liccardo 2014-07-22 12:58:20 +00:00
parent 83df040993
commit aa3fbea54b
1 changed files with 50 additions and 43 deletions

View File

@ -1101,17 +1101,23 @@ public class DatabaseManagement {
out.write(parsed);
out.newLine();
// to add a row to the map
if (row.length ==1){
RowString = parsed;
}else{
RowString = RowString + "," + parsed;
}
// to add a row to the map
RowString = RowString + "," + parsed;
// RowString = RowString + "," + parsed;
// mapSampleTableResult.put(String.valueOf(i),
// RowString);
// // check value row
//
// AnalysisLogger.getLogger().debug(
// "writing the value: " + RowString + " key: "
// + String.valueOf(i));
// AnalysisLogger.getLogger().debug(
// "writing the value: " + RowString + " key: "
// + String.valueOf(i));
// mapResult.put(Integer.valueOf(i), RowString);
mapResult.put(String.valueOf(i), RowString);
@ -1119,44 +1125,45 @@ public class DatabaseManagement {
}
}
} else if (result.size() == 1) {
// Object RowElement = (Object) result.get(0);
if (row[0] == null) {
row[0] = "";
}
// to parse the obtained results in order to align
// number
// values with those of postgres
String original = row[0].toString();
// // check value
// AnalysisLogger.getLogger().debug(
// "In DatabaseManagement->original value: "
// + original);
String parsed = "" + row[0];
if (original != "") {
// convert database datatypes to Java datatypes
if (DataTypeColumns == null
|| DataTypeColumns.size() == 0)
parsed = convertToJavaType(row[0].getClass()
.getName(), parsed);
else
parsed = convertToJavaType(DataTypeColumns.get(0),
parsed);
}
out.write(row[0].toString());
out.newLine();
// to add a row to the map
mapResult.put(String.valueOf(i), row[0].toString());
}
}
// else if (result.size() == 1) {
//
// // Object RowElement = (Object) result.get(0);
//
// if (row[0] == null) {
// row[0] = "";
// }
//
// // to parse the obtained results in order to align
// // number
// // values with those of postgres
// String original = row[0].toString();
//
// // // check value
// // AnalysisLogger.getLogger().debug(
// // "In DatabaseManagement->original value: "
// // + original);
//
// String parsed = "" + row[0];
//
// if (original != "") {
// // convert database datatypes to Java datatypes
// if (DataTypeColumns == null
// || DataTypeColumns.size() == 0)
// parsed = convertToJavaType(row[0].getClass()
// .getName(), parsed);
// else
// parsed = convertToJavaType(DataTypeColumns.get(0),
// parsed);
// }
//
// out.write(row[0].toString());
// out.newLine();
//
// // to add a row to the map
// mapResult.put(String.valueOf(i), row[0].toString());
//
// }
}