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(ColumnInformation[] columnInformation, int columnInformationLength, int maxFieldSize, Options options)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimalgetInternalBigDecimal(ColumnInformation columnInfo)Get BigDecimal from raw binary format.BigIntegergetInternalBigInteger(ColumnInformation columnInfo)Get BigInteger from raw binary format.booleangetInternalBoolean(ColumnInformation columnInfo)Get boolean from raw binary format.bytegetInternalByte(ColumnInformation columnInfo)Get byte from raw binary format.DategetInternalDate(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)Get date from raw binary format.doublegetInternalDouble(ColumnInformation columnInfo)Get double from raw binary format.floatgetInternalFloat(ColumnInformation columnInfo)Get float from raw binary format.intgetInternalInt(ColumnInformation columnInfo)Get int from raw binary format.LocalDategetInternalLocalDate(ColumnInformation columnInfo, TimeZone timeZone)Get LocalDate from raw binary format.LocalTimegetInternalLocalTime(ColumnInformation columnInfo, TimeZone timeZone)Get LocalTime from raw binary format.longgetInternalLong(ColumnInformation columnInfo)Get long from raw binary format.ObjectgetInternalObject(ColumnInformation columnInfo, TimeZone timeZone)Get Object from raw binary format.OffsetTimegetInternalOffsetTime(ColumnInformation columnInfo, TimeZone timeZone)Get OffsetTime from raw binary format.shortgetInternalShort(ColumnInformation columnInfo)Get short from raw binary format.StringgetInternalString(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)Get string from raw binary format.TimegetInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)Get time from raw binary format.TimestampgetInternalTimestamp(ColumnInformation columnInfo, Calendar userCalendar, TimeZone timeZone)Get timestamp from raw binary format.StringgetInternalTimeString(ColumnInformation columnInfo)Get Time in string format from raw binary format.ZonedDateTimegetInternalZonedDateTime(ColumnInformation columnInfo, Class clazz, TimeZone timeZone)Get ZonedDateTime from raw binary format.booleanisBinaryEncoded()Indicate if data is binary encoded.voidsetPosition(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(ColumnInformation[] columnInformation, int columnInformationLength, int maxFieldSize, Options options)
Constructor.- Parameters:
columnInformation- 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:
setPositionin classRowProtocol- Parameters:
newIndex- index (0 is first).- See Also:
- Resultset row protocol documentation
-
getInternalString
public String getInternalString(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone) throws SQLException
Get string from raw binary format.- Specified by:
getInternalStringin classRowProtocol- Parameters:
columnInfo- column informationcal- calendartimeZone- time zone- Returns:
- String value of raw bytes
- Throws:
SQLException- if conversion failed
-
getInternalInt
public int getInternalInt(ColumnInformation columnInfo) throws SQLException
Get int from raw binary format.- Specified by:
getInternalIntin 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(ColumnInformation columnInfo) throws SQLException
Get long from raw binary format.- Specified by:
getInternalLongin 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(ColumnInformation columnInfo) throws SQLException
Get float from raw binary format.- Specified by:
getInternalFloatin 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(ColumnInformation columnInfo) throws SQLException
Get double from raw binary format.- Specified by:
getInternalDoublein 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(ColumnInformation columnInfo) throws SQLException
Get BigDecimal from raw binary format.- Specified by:
getInternalBigDecimalin classRowProtocol- Parameters:
columnInfo- column information- Returns:
- BigDecimal value
- Throws:
SQLException- if column is not numeric
-
getInternalDate
public Date getInternalDate(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone) throws SQLException
Get date from raw binary format.- Specified by:
getInternalDatein classRowProtocol- Parameters:
columnInfo- column informationcal- calendartimeZone- time zone- Returns:
- date value
- Throws:
SQLException- if column is not compatible to Date
-
getInternalTime
public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone) throws SQLException
Get time from raw binary format.- Specified by:
getInternalTimein classRowProtocol- Parameters:
columnInfo- column informationcal- calendartimeZone- time zone- Returns:
- Time value
- Throws:
SQLException- if column cannot be converted to Time
-
getInternalTimestamp
public Timestamp getInternalTimestamp(ColumnInformation columnInfo, Calendar userCalendar, TimeZone timeZone) throws SQLException
Get timestamp from raw binary format.- Specified by:
getInternalTimestampin classRowProtocol- Parameters:
columnInfo- column informationuserCalendar- user calendartimeZone- time zone- Returns:
- timestamp value
- Throws:
SQLException- if column type is not compatible
-
getInternalObject
public Object getInternalObject(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException
Get Object from raw binary format.- Specified by:
getInternalObjectin classRowProtocol- Parameters:
columnInfo- column informationtimeZone- time zone- Returns:
- Object value
- Throws:
SQLException- if column type is not compatible
-
getInternalBoolean
public boolean getInternalBoolean(ColumnInformation columnInfo) throws SQLException
Get boolean from raw binary format.- Specified by:
getInternalBooleanin classRowProtocol- Parameters:
columnInfo- column information- Returns:
- boolean value
- Throws:
SQLException- if column type doesn't permit conversion
-
getInternalByte
public byte getInternalByte(ColumnInformation columnInfo) throws SQLException
Get byte from raw binary format.- Specified by:
getInternalBytein classRowProtocol- Parameters:
columnInfo- column information- Returns:
- byte value
- Throws:
SQLException- if column type doesn't permit conversion
-
getInternalShort
public short getInternalShort(ColumnInformation columnInfo) throws SQLException
Get short from raw binary format.- Specified by:
getInternalShortin classRowProtocol- Parameters:
columnInfo- column information- Returns:
- short value
- Throws:
SQLException- if column type doesn't permit conversion
-
getInternalTimeString
public String getInternalTimeString(ColumnInformation columnInfo)
Get Time in string format from raw binary format.- Specified by:
getInternalTimeStringin classRowProtocol- Parameters:
columnInfo- column information- Returns:
- time value
-
getInternalBigInteger
public BigInteger getInternalBigInteger(ColumnInformation columnInfo) throws SQLException
Get BigInteger from raw binary format.- Specified by:
getInternalBigIntegerin 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(ColumnInformation columnInfo, Class clazz, TimeZone timeZone) throws SQLException
Get ZonedDateTime from raw binary format.- Specified by:
getInternalZonedDateTimein 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(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException
Get OffsetTime from raw binary format.- Specified by:
getInternalOffsetTimein classRowProtocol- Parameters:
columnInfo- column informationtimeZone- time zone- Returns:
- OffsetTime value
- Throws:
SQLException- if column type doesn't permit conversion
-
getInternalLocalTime
public LocalTime getInternalLocalTime(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException
Get LocalTime from raw binary format.- Specified by:
getInternalLocalTimein classRowProtocol- Parameters:
columnInfo- column informationtimeZone- time zone- Returns:
- LocalTime value
- Throws:
SQLException- if column type doesn't permit conversion
-
getInternalLocalDate
public LocalDate getInternalLocalDate(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException
Get LocalDate from raw binary format.- Specified by:
getInternalLocalDatein 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:
isBinaryEncodedin classRowProtocol- Returns:
- always true.
-
-