code: protected long executeSelectCount(PreparedStatement preparedStatement) {
  		try (ResultSet resultSet = preparedStatement.executeQuery()) {
  			resultSet.next();
  			return resultSet.getLong(1);
  		} catch (SQLException x) {
  			throw new RuntimeException(x.getMessage());
  		}
  	}
docs: execution helpers