return _workingStatement.executeQuery(selectStmt.toString());
}
@Override
public long getExpectedRows() {
final CancelWriter selectInfo = new CancelWriter(HenPlus.msg());
Statement stmt = null;
ResultSet rset = null;
try {
selectInfo.print("determining number of rows...");
stmt = _session.createStatement();
final StringBuilder countStmt = new StringBuilder("SELECT count(*) from ");
countStmt.append(_table);
if (_whereClause != null) {
countStmt.append(" WHERE ");
countStmt.append(_whereClause);
}
rset = stmt.executeQuery(countStmt.toString());
rset.next();
return rset.getLong(1);
} catch (final Exception e) {
return -1;
} finally {
if (rset != null) {
try {
rset.close();
} catch (final Exception e) {
}
}
if (stmt != null) {
try {
stmt.close();
} catch (final Exception e) {
}
}
selectInfo.cancel();
}
}