- String com = "SELECT FinalStatus FROM ProteinLog WHERE JobID = '" + jobid + "';";
- System.out.println("Command: " + com);
- ResultSet results = session.execute(com);
- String status = results.one().getString("FinalStatus");
+ String status = "UNKNOWN";
+ String command = "SELECT FinalStatus FROM ProteinLog WHERE JobID = '" + jobid + "';";
+ try {
+ System.out.println("Command: " + command);
+ ResultSet results = session.execute(command);
+ Row raw = results.one();
+ if (null != raw) {
+ status = raw.getString("FinalStatus");
+ }
+ } catch (QueryExecutionException e) {
+ String mess = "CassandraRemover: query execution exception...";
+ System.out.println(mess);
+ log.error(mess);
+ log.error(e.getLocalizedMessage(), e.getCause());
+ } catch (QueryValidationException e) {
+ String mess = "CassandraRemover: query validation exception... Command: " + command;
+ System.out.println(mess);
+ log.error(mess);
+ log.error(e.getLocalizedMessage(), e.getCause());
+ }