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 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.Result
getAffectedItemsCount, getWarnings, getWarningsCount
-
Constructor Details
-
SqlUpdateResult
Constructor.- Parameters:
ok
-StatementExecuteOk
instance.
-
-
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 interfaceFetchResult<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 returningfalse
for the first time.- Specified by:
nextResult
in interfaceSqlResult
- Returns:
- was there a next result that we moved to?
-
fetchAll
Description copied from interface:FetchResult
Create a list of all elements in the result forcing internal buffering.- Specified by:
fetchAll
in interfaceFetchResult<Row>
- Returns:
- list of result elements
-
next
- Specified by:
next
in interfacejava.util.Iterator<Row>
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfacejava.util.Iterator<Row>
-
getColumnCount
public int getColumnCount()Description copied from interface:RowResult
Count of columns.- Specified by:
getColumnCount
in interfaceRowResult
- Returns:
- count
-
getColumns
Description copied from interface:RowResult
Metadata.- Specified by:
getColumns
in interfaceRowResult
- 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 interfaceRowResult
- 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 interfaceFetchResult<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 interfaceInsertResult
- Specified by:
getAutoIncrementValue
in interfaceSqlResult
- Returns:
- auto-increment value
-