*/
public Integer ReadDateTable(long queryDate) {
final long startTime = System.currentTimeMillis();
- String com = "SELECT jobtime, JobID FROM ProteinData WHERE jobtime = " + queryDate + ";";
+ String com = "SELECT count(*) FROM ProteinData WHERE jobtime = " + queryDate + ";";
System.out.println("Command: " + com);
ResultSet results = session.execute(com);
final long queryTime = System.currentTimeMillis();
System.out.println("Query time is " + (queryTime - startTime) + " msec");
- if (results.isExhausted())
- return 0;
- List<Row> rows = results.all();
+ Row row = results.one();
+ Integer count = (int) row.getLong(0);
final long endTime = System.currentTimeMillis();
- System.out.println("Processing time is " + (endTime - queryTime) + " msec");
- return rows.size();
+ System.out.println("Processing time is " + (endTime - queryTime) + " msec");
+ return count;
}
/*