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 ColumnDefinition
columnDefinition
The metadata for this result setprotected Resultset
nextResultset
protected int
resultId
The id (used when profiling) to identify usprotected ResultsetRows
rowData
The actual rowsprotected 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 dataprotected 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 usResultsetRows
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)
-
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: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 interfaceResultset
- Parameters:
metadata
- field-level metadata for the result set
-
getColumnDefinition
- Specified by:
getColumnDefinition
in interfaceResultset
-
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? -
getResultId
public int getResultId()Description copied from interface:Resultset
The id (used when profiling) to identify us- Specified by:
getResultId
in interfaceResultset
- 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 interfaceResultset
-
setNextResultset
- Specified by:
setNextResultset
in interfaceResultset
- Parameters:
nextResultset
- Sets the next result set in the result set chain for multiple result sets.
-
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 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:
clearNextResultset
in interfaceResultset
-
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 interfaceResultset
- 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 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:Resultset
Returns the server informational message returned from a DDL or DML statement (if any), or null if none.- Specified by:
getServerInfo
in interfaceResultset
- Returns:
- the server informational message
-
getRows
-