*/
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;
}
/*
query = new ArrayList<DataBase>();
for (Date date = start.getTime(); !start.after(end); start.add(Calendar.DATE, 1), date = start.getTime()) {
Integer res = DBInstance.ReadDateTable(date.getTime());
+ System.out.println("Command: " + res);
if (res == null)
continue;
DataBase db = new DataBase();