Package com.mysql.cj.protocol.a.result
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 ColumnDefinitioncolumnDefinitionThe metadata for this result setprotected ResultsetnextResultsetprotected intresultIdThe id (used when profiling) to identify usprotected ResultsetRowsrowDataThe actual rowsprotected java.lang.StringserverInfoAny info message from the server that was created while generating this result set (if 'info parsing' is enabled for the connection).protected RowthisRowPointer to current row dataprotected longupdateCountHow many rows were affected by UPDATE/INSERT/DELETE?protected longupdateIdValue 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 voidclearNextResultset()We can't do this ourselves, otherwise the contract for Statement.getMoreResults() won't work correctly.ColumnDefinitiongetColumnDefinition()ResultsetgetNextResultset()Returns the next ResultSet in a multi-resultset "chain", if any, null if none exists.intgetResultId()The id (used when profiling) to identify usResultsetRowsgetRows()java.lang.StringgetServerInfo()Returns the server informational message returned from a DDL or DML statement (if any), or null if none.longgetUpdateCount()Returns the update count for this result set (if one exists), otherwise -1.longgetUpdateID()Returns the AUTO_INCREMENT value for the DDL/DML statement which created this result set.booleanhasRows()Does the result set contain rows, or is it the result of a DDL or DML statement?voidinitRowsWithMetadata()Set metadata of this Resultset to ResultsetRows it contains.voidsetColumnDefinition(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).voidsetNextResultset(Resultset nextResultset)
-
Field Details
-
columnDefinition
The metadata for this result set -
rowData
The actual rows -
nextResultset
-
resultId
protected int resultIdThe id (used when profiling) to identify us -
updateCount
protected long updateCountHow many rows were affected by UPDATE/INSERT/DELETE? -
updateId
protected long updateIdValue generated for AUTO_INCREMENT columns -
serverInfo
protected java.lang.String serverInfoAny info message from the server that was created while generating this result set (if 'info parsing' is enabled for the connection). -
thisRow
Pointer to current row data
-
-
Constructor Details
-
NativeResultset
public NativeResultset() -
NativeResultset
Create a result set for an executeUpdate statement.- Parameters:
ok-OkPacket
-
NativeResultset
-
-
Method Details
-
setColumnDefinition
Description copied from interface:ResultsetSometimes 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:
setColumnDefinitionin interfaceResultset- Parameters:
metadata- field-level metadata for the result set
-
getColumnDefinition
- Specified by:
getColumnDefinitionin interfaceResultset
-
hasRows
public boolean hasRows()Description copied from interface:ResultsetDoes the result set contain rows, or is it the result of a DDL or DML statement? -
getResultId
public int getResultId()Description copied from interface:ResultsetThe id (used when profiling) to identify us- Specified by:
getResultIdin interfaceResultset- Returns:
- result id
-
initRowsWithMetadata
public void initRowsWithMetadata()Description copied from interface:ResultsetSet metadata of this Resultset to ResultsetRows it contains.- Specified by:
initRowsWithMetadatain interfaceResultset
-
setNextResultset
- Specified by:
setNextResultsetin interfaceResultset- Parameters:
nextResultset- Sets the next result set in the result set chain for multiple result sets.
-
getNextResultset
Description copied from interface:ResultsetReturns the next ResultSet in a multi-resultset "chain", if any, null if none exists.- Specified by:
getNextResultsetin interfaceResultset- 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:
clearNextResultsetin interfaceResultset
-
getUpdateCount
public long getUpdateCount()Description copied from interface:ResultsetReturns the update count for this result set (if one exists), otherwise -1.- Specified by:
getUpdateCountin interfaceResultset- Returns:
- return the update count for this result set (if one exists), otherwise -1.
-
getUpdateID
public long getUpdateID()Description copied from interface:ResultsetReturns the AUTO_INCREMENT value for the DDL/DML statement which created this result set.- Specified by:
getUpdateIDin interfaceResultset- 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:ResultsetReturns the server informational message returned from a DDL or DML statement (if any), or null if none.- Specified by:
getServerInfoin interfaceResultset- Returns:
- the server informational message
-
getRows
-