Class SqlUpdateResult

java.lang.Object
com.mysql.cj.xdevapi.UpdateResult
com.mysql.cj.xdevapi.SqlUpdateResult
All Implemented Interfaces:
QueryResult, FetchResult<Row>, InsertResult, Result, RowResult, SqlResult, java.lang.Iterable<Row>, java.util.Iterator<Row>

public class SqlUpdateResult
extends UpdateResult
implements SqlResult
SqlResult for insert, update, delete and DDL statements.
  • Field Summary

    Fields inherited from class com.mysql.cj.xdevapi.UpdateResult

    ok
  • Constructor Summary

    Constructors 
    Constructor Description
    SqlUpdateResult​(StatementExecuteOk ok)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    long count()
    How many items are in this result? This method forces internal buffering of the entire result.
    java.util.List<Row> fetchAll()
    Create a list of all elements in the result forcing internal buffering.
    java.lang.Long getAutoIncrementValue()
    Get the auto-increment value if one was generated from a row insert statement.
    int getColumnCount()
    Count of columns.
    java.util.List<java.lang.String> getColumnNames()
    Names of columns.
    java.util.List<Column> getColumns()
    Metadata.
    boolean hasData()
    Does this result have data? This indicates that the result was produced from a data-returning query.
    boolean hasNext()  
    Row next()  
    boolean nextResult()
    Move to the next result.

    Methods inherited from class com.mysql.cj.xdevapi.UpdateResult

    getAffectedItemsCount, getWarnings, getWarningsCount

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.mysql.cj.xdevapi.FetchResult

    fetchOne, iterator

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove

    Methods inherited from interface com.mysql.cj.xdevapi.Result

    getAffectedItemsCount, getWarnings, getWarningsCount
  • Constructor Details

  • Method Details

    • hasData

      public boolean hasData()
      Description copied from interface: FetchResult
      Does this result have data? This indicates that the result was produced from a data-returning query. It does not indicate whether there are more than 0 rows in the result.
      Specified by:
      hasData in interface FetchResult<Row>
      Returns:
      true if has data
    • nextResult

      public boolean nextResult()
      Description copied from interface: SqlResult
      Move to the next result. This method has no effect after returning false for the first time.
      Specified by:
      nextResult in interface SqlResult
      Returns:
      was there a next result that we moved to?
    • fetchAll

      public java.util.List<Row> fetchAll()
      Description copied from interface: FetchResult
      Create a list of all elements in the result forcing internal buffering.
      Specified by:
      fetchAll in interface FetchResult<Row>
      Returns:
      list of result elements
    • next

      public Row next()
      Specified by:
      next in interface java.util.Iterator<Row>
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<Row>
    • getColumnCount

      public int getColumnCount()
      Description copied from interface: RowResult
      Count of columns.
      Specified by:
      getColumnCount in interface RowResult
      Returns:
      count
    • getColumns

      public java.util.List<Column> getColumns()
      Description copied from interface: RowResult
      Metadata.
      Specified by:
      getColumns in interface RowResult
      Returns:
      list of result Column objects
    • getColumnNames

      public java.util.List<java.lang.String> getColumnNames()
      Description copied from interface: RowResult
      Names of columns.
      Specified by:
      getColumnNames in interface RowResult
      Returns:
      list of result column names
    • count

      public long count()
      Description copied from interface: FetchResult
      How many items are in this result? This method forces internal buffering of the entire result.
      Specified by:
      count in interface FetchResult<Row>
      Returns:
      number of elements in result
    • getAutoIncrementValue

      public java.lang.Long getAutoIncrementValue()
      Description copied from interface: InsertResult
      Get the auto-increment value if one was generated from a row insert statement.
      Specified by:
      getAutoIncrementValue in interface InsertResult
      Specified by:
      getAutoIncrementValue in interface SqlResult
      Returns:
      auto-increment value