Top Methods
com.mysql.cj.result

public Interface Row

extends ProtocolEntity
Known Direct Subinterfaces
com.mysql.cj.protocol.ResultsetRow
Known Direct Implementers
com.mysql.cj.protocol.x.XProtocolRow
Imports
com.mysql.cj.Messages, com.mysql.cj.exceptions.CJOperationNotSupportedException, .ExceptionFactory, com.mysql.cj.protocol.ColumnDefinition, .ProtocolEntity, .ValueDecoder

Method Summary

Modifier and TypeMethod and Description
public default byte[]

Returns:

the value for the given column; if the value is SQL NULL, the value returned is null
getBytes
(int
index of column (starting at 0) to return from.
columnIndex
)

Returns the value at the given column as a byte array.

public boolean

Returns:

true if the column value is NULL, false if not.
getNull
(int
of the column value (starting at 0) to check.
columnIndex
)

Check whether a column is NULL and update the 'wasNull' status.

public <
type to decode to
T
>
T

Returns:

The return value from the value factory
getValue
(int
index of column to retrieve value from (0-indexed, not JDBC 1-indexed)
columnIndex
,
ValueFactory<T>
value factory used to create the return value after decoding
vf
)

Retrieve a value for the given column.

public default void
setBytes(int
index of the column (starting at 0) to set to.
columnIndex
,
byte[]
the (raw) value to set
value
)

Sets the given byte array as a raw column value (only works currently with ByteArrayRow).

public default Row

Returns:

Row
setMetadata
(ColumnDefinition columnDefinition)

Set metadata to enable getValue functionality.

public boolean

Returns:

true if the last retrieved value was NULL.
wasNull
()

Was the last value retrieved a NULL value?

Method Detail

getBytesback to summary
public default byte[] getBytes(int columnIndex)

Returns the value at the given column as a byte array. The bytes represent the raw values returned by the server.

Parameters
columnIndex:int

index of column (starting at 0) to return from.

Returns:byte[]

the value for the given column; if the value is SQL NULL, the value returned is null

getNullback to summary
public boolean getNull(int columnIndex)

Check whether a column is NULL and update the 'wasNull' status.

Parameters
columnIndex:int

of the column value (starting at 0) to check.

Returns:boolean

true if the column value is NULL, false if not.

getValueback to summary
public <T> T getValue(int columnIndex, ValueFactory<T> vf)

Retrieve a value for the given column. This is the main facility to access values from the Row involving ValueDecoder and ValueFactory chain. Metadata must be set via Row constructor or setMetadata(ColumnDefinition) call before calling this method to allow correct columnIndex boundaries check and data type recognition.

Parameters
<T>
type to decode to
columnIndex:int

index of column to retrieve value from (0-indexed, not JDBC 1-indexed)

vf:ValueFactory<T>

value factory used to create the return value after decoding

Returns:T

The return value from the value factory

setBytesback to summary
public default void setBytes(int columnIndex, byte[] value)

Sets the given byte array as a raw column value (only works currently with ByteArrayRow).

Parameters
columnIndex:int

index of the column (starting at 0) to set to.

value:byte[]

the (raw) value to set

setMetadataback to summary
public default Row setMetadata(ColumnDefinition columnDefinition)

Set metadata to enable getValue functionality.

Parameters
columnDefinition:ColumnDefinition

ColumnDefinition

Returns:Row

Row

wasNullback to summary
public boolean wasNull()

Was the last value retrieved a NULL value?

Returns:boolean

true if the last retrieved value was NULL.