Changeset 98 for trunk/CrossPare/src/de/ugoe/cs/cpdp/eval
- Timestamp:
- 05/13/16 09:18:15 (9 years ago)
- Location:
- trunk/CrossPare/src/de/ugoe/cs/cpdp/eval
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/IResultStorage.java
r86 r98 43 43 * @param productName 44 44 * name of the product 45 * @return true of the results ofr the given product and experiment are contained in the result 46 * storage 45 * @return number of contained resultsfor the given product and experiment 47 46 */ 48 public booleancontainsResult(String experimentName, String productName);47 public int containsResult(String experimentName, String productName); 49 48 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/eval/MySQLResultStorage.java
r97 r98 162 162 */ 163 163 @Override 164 public booleancontainsResult(String experimentName, String productName) {164 public int containsResult(String experimentName, String productName) { 165 165 String sql = "SELECT COUNT(*) as cnt FROM crosspare.results WHERE configurationName=\'" + 166 166 experimentName + "\' AND productName=\'" + productName + "\';"; 167 167 Statement stmt; 168 boolean contained = false;169 168 try { 170 169 stmt = connectionPool.getConnection().createStatement(); 171 170 ResultSet results = stmt.executeQuery(sql); 172 171 results.next(); 173 int count = results.getInt("cnt"); 174 contained = count > 0; 172 return results.getInt("cnt"); 175 173 } 176 174 catch (SQLException e) { … … 179 177 Console.printerr("SQLState: " + e.getSQLState() + "\n"); 180 178 Console.printerr("VendorError: " + e.getErrorCode() + "\n"); 181 Console.printerr("\nskipping product since we could not check if the results is available"); 182 contained = true; 179 return 0; 183 180 } 184 return contained;185 181 } 186 182 }
Note: See TracChangeset
for help on using the changeset viewer.