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