Class NativeResultset

java.lang.Object
com.mysql.cj.protocol.a.result.NativeResultset
All Implemented Interfaces:
ProtocolEntity, Resultset
Direct Known Subclasses:
ResultSetImpl

public class NativeResultset
extends java.lang.Object
implements Resultset
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.mysql.cj.protocol.Resultset

    Resultset.Concurrency, Resultset.Type
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected ColumnDefinition columnDefinition
    The metadata for this result set
    protected Resultset nextResultset  
    protected int resultId
    The id (used when profiling) to identify us
    protected ResultsetRows rowData
    The actual rows
    protected java.lang.String serverInfo
    Any info message from the server that was created while generating this result set (if 'info parsing' is enabled for the connection).
    protected Row thisRow
    Pointer to current row data
    protected long updateCount
    How many rows were affected by UPDATE/INSERT/DELETE?
    protected long updateId
    Value generated for AUTO_INCREMENT columns
  • Constructor Summary

    Constructors 
    Constructor Description
    NativeResultset()  
    NativeResultset​(OkPacket ok)
    Create a result set for an executeUpdate statement.
    NativeResultset​(ResultsetRows rows)  
  • Method Summary

    Modifier and Type Method Description
    void clearNextResultset()
    We can't do this ourselves, otherwise the contract for Statement.getMoreResults() won't work correctly.
    ColumnDefinition getColumnDefinition()  
    Resultset getNextResultset()
    Returns the next ResultSet in a multi-resultset "chain", if any, null if none exists.
    int getResultId()
    The id (used when profiling) to identify us
    ResultsetRows getRows()  
    java.lang.String getServerInfo()
    Returns the server informational message returned from a DDL or DML statement (if any), or null if none.
    long getUpdateCount()
    Returns the update count for this result set (if one exists), otherwise -1.
    long getUpdateID()
    Returns the AUTO_INCREMENT value for the DDL/DML statement which created this result set.
    boolean hasRows()
    Does the result set contain rows, or is it the result of a DDL or DML statement?
    void initRowsWithMetadata()
    Set metadata of this Resultset to ResultsetRows it contains.
    void setColumnDefinition​(ColumnDefinition metadata)
    Sometimes the driver doesn't have metadata before consuming the result set rows (because it's cached), or need to coerce the metadata returned by queries into that required by the particular specification (eg metadata returned by metadata queries into that required by the JDBC specification).
    void setNextResultset​(Resultset nextResultset)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • columnDefinition

      protected ColumnDefinition columnDefinition
      The metadata for this result set
    • rowData

      protected ResultsetRows rowData
      The actual rows
    • nextResultset

      protected Resultset nextResultset
    • resultId

      protected int resultId
      The id (used when profiling) to identify us
    • updateCount

      protected long updateCount
      How many rows were affected by UPDATE/INSERT/DELETE?
    • updateId

      protected long updateId
      Value generated for AUTO_INCREMENT columns
    • serverInfo

      protected java.lang.String serverInfo
      Any info message from the server that was created while generating this result set (if 'info parsing' is enabled for the connection).
    • thisRow

      protected Row thisRow
      Pointer to current row data
  • Constructor Details

  • Method Details

    • setColumnDefinition

      public void setColumnDefinition​(ColumnDefinition metadata)
      Description copied from interface: Resultset
      Sometimes the driver doesn't have metadata before consuming the result set rows (because it's cached), or need to coerce the metadata returned by queries into that required by the particular specification (eg metadata returned by metadata queries into that required by the JDBC specification). So it can call this to set it after the fact.
      Specified by:
      setColumnDefinition in interface Resultset
      Parameters:
      metadata - field-level metadata for the result set
    • getColumnDefinition

      public ColumnDefinition getColumnDefinition()
      Specified by:
      getColumnDefinition in interface Resultset
    • hasRows

      public boolean hasRows()
      Description copied from interface: Resultset
      Does the result set contain rows, or is it the result of a DDL or DML statement?
      Specified by:
      hasRows in interface Resultset
      Returns:
      true if result set contains rows
    • getResultId

      public int getResultId()
      Description copied from interface: Resultset
      The id (used when profiling) to identify us
      Specified by:
      getResultId in interface Resultset
      Returns:
      result id
    • initRowsWithMetadata

      public void initRowsWithMetadata()
      Description copied from interface: Resultset
      Set metadata of this Resultset to ResultsetRows it contains.
      Specified by:
      initRowsWithMetadata in interface Resultset
    • setNextResultset

      public void setNextResultset​(Resultset nextResultset)
      Specified by:
      setNextResultset in interface Resultset
      Parameters:
      nextResultset - Sets the next result set in the result set chain for multiple result sets.
    • getNextResultset

      public Resultset getNextResultset()
      Description copied from interface: Resultset
      Returns the next ResultSet in a multi-resultset "chain", if any, null if none exists.
      Specified by:
      getNextResultset in interface Resultset
      Returns:
      the nextResultSet, if any, null if none exists.
    • clearNextResultset

      public void clearNextResultset()
      We can't do this ourselves, otherwise the contract for Statement.getMoreResults() won't work correctly.
      Specified by:
      clearNextResultset in interface Resultset
    • getUpdateCount

      public long getUpdateCount()
      Description copied from interface: Resultset
      Returns the update count for this result set (if one exists), otherwise -1.
      Specified by:
      getUpdateCount in interface Resultset
      Returns:
      return the update count for this result set (if one exists), otherwise -1.
    • getUpdateID

      public long getUpdateID()
      Description copied from interface: Resultset
      Returns the AUTO_INCREMENT value for the DDL/DML statement which created this result set.
      Specified by:
      getUpdateID in interface Resultset
      Returns:
      the AUTO_INCREMENT value for the DDL/DML statement which created this result set.
    • getServerInfo

      public java.lang.String getServerInfo()
      Description copied from interface: Resultset
      Returns the server informational message returned from a DDL or DML statement (if any), or null if none.
      Specified by:
      getServerInfo in interface Resultset
      Returns:
      the server informational message
    • getRows

      public ResultsetRows getRows()
      Specified by:
      getRows in interface Resultset