def query(qstr, &blk)
    check_closed

    stmt = @spool.take
    begin
      rset = stmt.execute_query(qstr)
    rescue Exception => e
      @spool.give stmt
      raise
    end

    enum = ResultSet.send(:new, rset) { @spool.give stmt }
    if block_given?
      enum.each do |row|
        yield row
      end
    else
      enum
    end
  end
def query(qstr, &blk)
    check_closed

    stmt = @spool.take
    begin
      rset = stmt.execute_query(qstr)
    rescue Exception => e
      @spool.give stmt
      raise
    end

    enum = ResultSet.send(:new, rset) { @spool.give stmt }
    if block_given?
      enum.each do |row|
        yield row
      end
    else
      enum
    end
  end
Executes a select query.
 When a code block is given, each row of the result is passed to the block one by one.
 If not given, ResultSet is returned, which can be used to enumerate through the result set.
 ResultSet is closed automatically when all the rows in the result set is consumed.

 @example Nested querying
   conn.query("SELECT a FROM T") do | trow |
     conn.query("SELECT * FROM U_#{trow.a}").each_slice(10) do | urows |
       # ...
     end
   end
 @param [String] qstr SQL string
 @yield [JDBCHelper::Connection::Row]
 @return [Array]