allpredictions += "'" + predictionname + "':'" + prediction + "',";
}
String final_prediction = "";
- if (null != allpredictions) {
+ if (!allpredictions.equals("")) {
final_prediction = allpredictions.substring(0, allpredictions.length() - 1);
}
session.execute(com3);
}
- // update some internal tables
+ // update some internal query tables
String check3 = "SELECT * FROM MainParameters WHERE Name = 'EarliestJobDate';";
ResultSet results3 = session.execute(check3);
boolean updateparameter = true;
+ "');";
session.execute(com);
}
- String check4 = "SELECT * FROM MainParameters WHERE Name = 'TotalNumberOfJobs';";
+ String check4 = "SELECT * FROM JobDateInfo WHERE jobday = " + jobtime + ";";
ResultSet results4 = session.execute(check4);
updateparameter = true;
int njobs = 1;
if (!results4.isExhausted()) {
Row r = results4.one();
- njobs += Integer.parseInt(r.getString("Value"));
+ njobs += r.getLong("Total");
}
- String com = "INSERT INTO MainParameters " + "(Name, Value)" + " VALUES ('TotalNumberOfJobs','" + String.valueOf(njobs) + "');";
+ String com = "INSERT INTO JobDateInfo " + "(jobday, Total)" + " VALUES (" + jobtime + "," + njobs + ");";
session.execute(com);
return 1;