Package com.mysql.cj.xdevapi
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
-
Constructor Summary
Constructors Constructor Description SqlUpdateResult(StatementExecuteOk ok)Constructor. -
Method Summary
Modifier and Type Method Description longcount()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.LonggetAutoIncrementValue()Get the auto-increment value if one was generated from a row insert statement.intgetColumnCount()Count of columns.java.util.List<java.lang.String>getColumnNames()Names of columns.java.util.List<Column>getColumns()Metadata.booleanhasData()Does this result have data? This indicates that the result was produced from a data-returning query.booleanhasNext()Rownext()booleannextResult()Move to the next result.Methods inherited from class com.mysql.cj.xdevapi.UpdateResult
getAffectedItemsCount, getWarnings, getWarningsCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mysql.cj.xdevapi.Result
getAffectedItemsCount, getWarnings, getWarningsCount
-
Constructor Details
-
SqlUpdateResult
Constructor.- Parameters:
ok-StatementExecuteOkinstance.
-
-
Method Details
-
hasData
public boolean hasData()Description copied from interface:FetchResultDoes 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:
hasDatain interfaceFetchResult<Row>- Returns:
- true if has data
-
nextResult
public boolean nextResult()Description copied from interface:SqlResultMove to the next result. This method has no effect after returningfalsefor the first time.- Specified by:
nextResultin interfaceSqlResult- Returns:
- was there a next result that we moved to?
-
fetchAll
Description copied from interface:FetchResultCreate a list of all elements in the result forcing internal buffering.- Specified by:
fetchAllin interfaceFetchResult<Row>- Returns:
- list of result elements
-
next
- Specified by:
nextin interfacejava.util.Iterator<Row>
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfacejava.util.Iterator<Row>
-
getColumnCount
public int getColumnCount()Description copied from interface:RowResultCount of columns.- Specified by:
getColumnCountin interfaceRowResult- Returns:
- count
-
getColumns
Description copied from interface:RowResultMetadata.- Specified by:
getColumnsin interfaceRowResult- Returns:
- list of result
Columnobjects
-
getColumnNames
public java.util.List<java.lang.String> getColumnNames()Description copied from interface:RowResultNames of columns.- Specified by:
getColumnNamesin interfaceRowResult- Returns:
- list of result column names
-
count
public long count()Description copied from interface:FetchResultHow many items are in this result? This method forces internal buffering of the entire result.- Specified by:
countin interfaceFetchResult<Row>- Returns:
- number of elements in result
-
getAutoIncrementValue
public java.lang.Long getAutoIncrementValue()Description copied from interface:InsertResultGet the auto-increment value if one was generated from a row insert statement.- Specified by:
getAutoIncrementValuein interfaceInsertResult- Specified by:
getAutoIncrementValuein interfaceSqlResult- Returns:
- auto-increment value
-