Class BinaryRowProtocol
- java.lang.Object
-
- org.mariadb.jdbc.internal.com.read.resultset.rowprotocol.RowProtocol
-
- org.mariadb.jdbc.internal.com.read.resultset.rowprotocol.BinaryRowProtocol
-
public class BinaryRowProtocol extends RowProtocol
-
-
Field Summary
-
Fields inherited from class org.mariadb.jdbc.internal.com.read.resultset.rowprotocol.RowProtocol
BIT_LAST_FIELD_NOT_NULL, BIT_LAST_FIELD_NULL, BIT_LAST_ZERO_DATE, buf, index, isIntegerRegex, lastValueNull, length, maxFieldSize, NULL_LENGTH, options, pos, TEXT_LOCAL_DATE_TIME, TEXT_OFFSET_DATE_TIME, TEXT_ZONED_DATE_TIME, TINYINT1_IS_BIT, YEAR_IS_DATE_TYPE
-
-
Constructor Summary
Constructors Constructor Description BinaryRowProtocol(ColumnDefinition[] columnDefinition, int columnInformationLength, int maxFieldSize, Options options)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimal
getInternalBigDecimal(ColumnDefinition columnInfo)
Get BigDecimal from raw binary format.BigInteger
getInternalBigInteger(ColumnDefinition columnInfo)
Get BigInteger from raw binary format.boolean
getInternalBoolean(ColumnDefinition columnInfo)
Get boolean from raw binary format.byte
getInternalByte(ColumnDefinition columnInfo)
Get byte from raw binary format.Date
getInternalDate(ColumnDefinition columnInfo, Calendar cal, TimeZone timeZone)
Get date from raw binary format.double
getInternalDouble(ColumnDefinition columnInfo)
Get double from raw binary format.float
getInternalFloat(ColumnDefinition columnInfo)
Get float from raw binary format.int
getInternalInt(ColumnDefinition columnInfo)
Get int from raw binary format.LocalDate
getInternalLocalDate(ColumnDefinition columnInfo, TimeZone timeZone)
Get LocalDate from raw binary format.LocalTime
getInternalLocalTime(ColumnDefinition columnInfo, TimeZone timeZone)
Get LocalTime from raw binary format.long
getInternalLong(ColumnDefinition columnInfo)
Get long from raw binary format.Object
getInternalObject(ColumnDefinition columnInfo, TimeZone timeZone)
Get Object from raw binary format.OffsetTime
getInternalOffsetTime(ColumnDefinition columnInfo, TimeZone timeZone)
Get OffsetTime from raw binary format.short
getInternalShort(ColumnDefinition columnInfo)
Get short from raw binary format.String
getInternalString(ColumnDefinition columnInfo, Calendar cal, TimeZone timeZone)
Get string from raw binary format.Time
getInternalTime(ColumnDefinition columnInfo, Calendar cal, TimeZone timeZone)
Get time from raw binary format.Timestamp
getInternalTimestamp(ColumnDefinition columnInfo, Calendar userCalendar, TimeZone timeZone)
Get timestamp from raw binary format.String
getInternalTimeString(ColumnDefinition columnInfo)
Get Time in string format from raw binary format.ZonedDateTime
getInternalZonedDateTime(ColumnDefinition columnInfo, Class clazz, TimeZone timeZone)
Get ZonedDateTime from raw binary format.boolean
isBinaryEncoded()
Indicate if data is binary encoded.void
setPosition(int newIndex)
Set length and pos indicator to asked index.-
Methods inherited from class org.mariadb.jdbc.internal.com.read.resultset.rowprotocol.RowProtocol
extractNanos, getInternalMediumInt, getInternalSmallInt, getInternalTinyInt, getLengthMaxFieldSize, getMaxFieldSize, lastValueWasNull, parseBit, rangeCheck, rangeCheck, resetRow, wasNull, zeroFillingIfNeeded
-
-
-
-
Constructor Detail
-
BinaryRowProtocol
public BinaryRowProtocol(ColumnDefinition[] columnDefinition, int columnInformationLength, int maxFieldSize, Options options)
Constructor.- Parameters:
columnDefinition
- column information.columnInformationLength
- number of columnsmaxFieldSize
- max field sizeoptions
- connection options
-
-
Method Detail
-
setPosition
public void setPosition(int newIndex)
Set length and pos indicator to asked index.- Specified by:
setPosition
in classRowProtocol
- Parameters:
newIndex
- index (0 is first).- See Also:
- Resultset row protocol documentation
-
getInternalString
public String getInternalString(ColumnDefinition columnInfo, Calendar cal, TimeZone timeZone) throws SQLException
Get string from raw binary format.- Specified by:
getInternalString
in classRowProtocol
- Parameters:
columnInfo
- column informationcal
- calendartimeZone
- time zone- Returns:
- String value of raw bytes
- Throws:
SQLException
- if conversion failed
-
getInternalInt
public int getInternalInt(ColumnDefinition columnInfo) throws SQLException
Get int from raw binary format.- Specified by:
getInternalInt
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- int value
- Throws:
SQLException
- if column is not numeric or is not in Integer bounds.
-
getInternalLong
public long getInternalLong(ColumnDefinition columnInfo) throws SQLException
Get long from raw binary format.- Specified by:
getInternalLong
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- long value
- Throws:
SQLException
- if column is not numeric or is not in Long bounds (for big unsigned values)
-
getInternalFloat
public float getInternalFloat(ColumnDefinition columnInfo) throws SQLException
Get float from raw binary format.- Specified by:
getInternalFloat
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- float value
- Throws:
SQLException
- if column is not numeric or is not in Float bounds.
-
getInternalDouble
public double getInternalDouble(ColumnDefinition columnInfo) throws SQLException
Get double from raw binary format.- Specified by:
getInternalDouble
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- double value
- Throws:
SQLException
- if column is not numeric or is not in Double bounds (unsigned columns).
-
getInternalBigDecimal
public BigDecimal getInternalBigDecimal(ColumnDefinition columnInfo) throws SQLException
Get BigDecimal from raw binary format.- Specified by:
getInternalBigDecimal
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- BigDecimal value
- Throws:
SQLException
- if column is not numeric
-
getInternalDate
public Date getInternalDate(ColumnDefinition columnInfo, Calendar cal, TimeZone timeZone) throws SQLException
Get date from raw binary format.- Specified by:
getInternalDate
in classRowProtocol
- Parameters:
columnInfo
- column informationcal
- calendartimeZone
- time zone- Returns:
- date value
- Throws:
SQLException
- if column is not compatible to Date
-
getInternalTime
public Time getInternalTime(ColumnDefinition columnInfo, Calendar cal, TimeZone timeZone) throws SQLException
Get time from raw binary format.- Specified by:
getInternalTime
in classRowProtocol
- Parameters:
columnInfo
- column informationcal
- calendartimeZone
- time zone- Returns:
- Time value
- Throws:
SQLException
- if column cannot be converted to Time
-
getInternalTimestamp
public Timestamp getInternalTimestamp(ColumnDefinition columnInfo, Calendar userCalendar, TimeZone timeZone) throws SQLException
Get timestamp from raw binary format.- Specified by:
getInternalTimestamp
in classRowProtocol
- Parameters:
columnInfo
- column informationuserCalendar
- user calendartimeZone
- time zone- Returns:
- timestamp value
- Throws:
SQLException
- if column type is not compatible
-
getInternalObject
public Object getInternalObject(ColumnDefinition columnInfo, TimeZone timeZone) throws SQLException
Get Object from raw binary format.- Specified by:
getInternalObject
in classRowProtocol
- Parameters:
columnInfo
- column informationtimeZone
- time zone- Returns:
- Object value
- Throws:
SQLException
- if column type is not compatible
-
getInternalBoolean
public boolean getInternalBoolean(ColumnDefinition columnInfo) throws SQLException
Get boolean from raw binary format.- Specified by:
getInternalBoolean
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- boolean value
- Throws:
SQLException
- if column type doesn't permit conversion
-
getInternalByte
public byte getInternalByte(ColumnDefinition columnInfo) throws SQLException
Get byte from raw binary format.- Specified by:
getInternalByte
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- byte value
- Throws:
SQLException
- if column type doesn't permit conversion
-
getInternalShort
public short getInternalShort(ColumnDefinition columnInfo) throws SQLException
Get short from raw binary format.- Specified by:
getInternalShort
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- short value
- Throws:
SQLException
- if column type doesn't permit conversion
-
getInternalTimeString
public String getInternalTimeString(ColumnDefinition columnInfo)
Get Time in string format from raw binary format.- Specified by:
getInternalTimeString
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- time value
-
getInternalBigInteger
public BigInteger getInternalBigInteger(ColumnDefinition columnInfo) throws SQLException
Get BigInteger from raw binary format.- Specified by:
getInternalBigInteger
in classRowProtocol
- Parameters:
columnInfo
- column information- Returns:
- BigInteger value
- Throws:
SQLException
- if column type doesn't permit conversion or value is not in BigInteger range
-
getInternalZonedDateTime
public ZonedDateTime getInternalZonedDateTime(ColumnDefinition columnInfo, Class clazz, TimeZone timeZone) throws SQLException
Get ZonedDateTime from raw binary format.- Specified by:
getInternalZonedDateTime
in classRowProtocol
- Parameters:
columnInfo
- column informationclazz
- asked classtimeZone
- time zone- Returns:
- ZonedDateTime value
- Throws:
SQLException
- if column type doesn't permit conversion
-
getInternalOffsetTime
public OffsetTime getInternalOffsetTime(ColumnDefinition columnInfo, TimeZone timeZone) throws SQLException
Get OffsetTime from raw binary format.- Specified by:
getInternalOffsetTime
in classRowProtocol
- Parameters:
columnInfo
- column informationtimeZone
- time zone- Returns:
- OffsetTime value
- Throws:
SQLException
- if column type doesn't permit conversion
-
getInternalLocalTime
public LocalTime getInternalLocalTime(ColumnDefinition columnInfo, TimeZone timeZone) throws SQLException
Get LocalTime from raw binary format.- Specified by:
getInternalLocalTime
in classRowProtocol
- Parameters:
columnInfo
- column informationtimeZone
- time zone- Returns:
- LocalTime value
- Throws:
SQLException
- if column type doesn't permit conversion
-
getInternalLocalDate
public LocalDate getInternalLocalDate(ColumnDefinition columnInfo, TimeZone timeZone) throws SQLException
Get LocalDate from raw binary format.- Specified by:
getInternalLocalDate
in classRowProtocol
- Parameters:
columnInfo
- column informationtimeZone
- time zone- Returns:
- LocalDate value
- Throws:
SQLException
- if column type doesn't permit conversion
-
isBinaryEncoded
public boolean isBinaryEncoded()
Indicate if data is binary encoded.- Specified by:
isBinaryEncoded
in classRowProtocol
- Returns:
- always true.
-
-