Class BinaryRowProtocol

    • Field Detail

      • columnInformationLength

        private final int columnInformationLength
    • Constructor Detail

      • BinaryRowProtocol

        public BinaryRowProtocol​(ColumnDefinition[] columnDefinition,
                                 int columnInformationLength,
                                 int maxFieldSize,
                                 Options options)
        Constructor.
        Parameters:
        columnDefinition - column information.
        columnInformationLength - number of columns
        maxFieldSize - max field size
        options - connection options
    • Method Detail

      • getInternalString

        public java.lang.String getInternalString​(ColumnDefinition columnInfo,
                                                  java.util.Calendar cal,
                                                  java.util.TimeZone timeZone)
                                           throws java.sql.SQLException
        Get string from raw binary format.
        Specified by:
        getInternalString in class RowProtocol
        Parameters:
        columnInfo - column information
        cal - calendar
        timeZone - time zone
        Returns:
        String value of raw bytes
        Throws:
        java.sql.SQLException - if conversion failed
      • getInternalInt

        public int getInternalInt​(ColumnDefinition columnInfo)
                           throws java.sql.SQLException
        Get int from raw binary format.
        Specified by:
        getInternalInt in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        int value
        Throws:
        java.sql.SQLException - if column is not numeric or is not in Integer bounds.
      • getInternalLong

        public long getInternalLong​(ColumnDefinition columnInfo)
                             throws java.sql.SQLException
        Get long from raw binary format.
        Specified by:
        getInternalLong in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        long value
        Throws:
        java.sql.SQLException - if column is not numeric or is not in Long bounds (for big unsigned values)
      • getInternalFloat

        public float getInternalFloat​(ColumnDefinition columnInfo)
                               throws java.sql.SQLException
        Get float from raw binary format.
        Specified by:
        getInternalFloat in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        float value
        Throws:
        java.sql.SQLException - if column is not numeric or is not in Float bounds.
      • getInternalDouble

        public double getInternalDouble​(ColumnDefinition columnInfo)
                                 throws java.sql.SQLException
        Get double from raw binary format.
        Specified by:
        getInternalDouble in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        double value
        Throws:
        java.sql.SQLException - if column is not numeric or is not in Double bounds (unsigned columns).
      • getInternalBigDecimal

        public java.math.BigDecimal getInternalBigDecimal​(ColumnDefinition columnInfo)
                                                   throws java.sql.SQLException
        Get BigDecimal from raw binary format.
        Specified by:
        getInternalBigDecimal in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        BigDecimal value
        Throws:
        java.sql.SQLException - if column is not numeric
      • getInternalDate

        public java.sql.Date getInternalDate​(ColumnDefinition columnInfo,
                                             java.util.Calendar cal,
                                             java.util.TimeZone timeZone)
                                      throws java.sql.SQLException
        Get date from raw binary format.
        Specified by:
        getInternalDate in class RowProtocol
        Parameters:
        columnInfo - column information
        cal - calendar
        timeZone - time zone
        Returns:
        date value
        Throws:
        java.sql.SQLException - if column is not compatible to Date
      • getInternalTime

        public java.sql.Time getInternalTime​(ColumnDefinition columnInfo,
                                             java.util.Calendar cal,
                                             java.util.TimeZone timeZone)
                                      throws java.sql.SQLException
        Get time from raw binary format.
        Specified by:
        getInternalTime in class RowProtocol
        Parameters:
        columnInfo - column information
        cal - calendar
        timeZone - time zone
        Returns:
        Time value
        Throws:
        java.sql.SQLException - if column cannot be converted to Time
      • getInternalTimestamp

        public java.sql.Timestamp getInternalTimestamp​(ColumnDefinition columnInfo,
                                                       java.util.Calendar userCalendar,
                                                       java.util.TimeZone timeZone)
                                                throws java.sql.SQLException
        Get timestamp from raw binary format.
        Specified by:
        getInternalTimestamp in class RowProtocol
        Parameters:
        columnInfo - column information
        userCalendar - user calendar
        timeZone - time zone
        Returns:
        timestamp value
        Throws:
        java.sql.SQLException - if column type is not compatible
      • getInternalObject

        public java.lang.Object getInternalObject​(ColumnDefinition columnInfo,
                                                  java.util.TimeZone timeZone)
                                           throws java.sql.SQLException
        Get Object from raw binary format.
        Specified by:
        getInternalObject in class RowProtocol
        Parameters:
        columnInfo - column information
        timeZone - time zone
        Returns:
        Object value
        Throws:
        java.sql.SQLException - if column type is not compatible
      • getInternalBoolean

        public boolean getInternalBoolean​(ColumnDefinition columnInfo)
                                   throws java.sql.SQLException
        Get boolean from raw binary format.
        Specified by:
        getInternalBoolean in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        boolean value
        Throws:
        java.sql.SQLException - if column type doesn't permit conversion
      • getInternalByte

        public byte getInternalByte​(ColumnDefinition columnInfo)
                             throws java.sql.SQLException
        Get byte from raw binary format.
        Specified by:
        getInternalByte in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        byte value
        Throws:
        java.sql.SQLException - if column type doesn't permit conversion
      • getInternalShort

        public short getInternalShort​(ColumnDefinition columnInfo)
                               throws java.sql.SQLException
        Get short from raw binary format.
        Specified by:
        getInternalShort in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        short value
        Throws:
        java.sql.SQLException - if column type doesn't permit conversion
      • getInternalTimeString

        public java.lang.String getInternalTimeString​(ColumnDefinition columnInfo)
        Get Time in string format from raw binary format.
        Specified by:
        getInternalTimeString in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        time value
      • getInternalBigInteger

        public java.math.BigInteger getInternalBigInteger​(ColumnDefinition columnInfo)
                                                   throws java.sql.SQLException
        Get BigInteger from raw binary format.
        Specified by:
        getInternalBigInteger in class RowProtocol
        Parameters:
        columnInfo - column information
        Returns:
        BigInteger value
        Throws:
        java.sql.SQLException - if column type doesn't permit conversion or value is not in BigInteger range
      • getInternalZonedDateTime

        public java.time.ZonedDateTime getInternalZonedDateTime​(ColumnDefinition columnInfo,
                                                                java.lang.Class clazz,
                                                                java.util.TimeZone timeZone)
                                                         throws java.sql.SQLException
        Get ZonedDateTime from raw binary format.
        Specified by:
        getInternalZonedDateTime in class RowProtocol
        Parameters:
        columnInfo - column information
        clazz - asked class
        timeZone - time zone
        Returns:
        ZonedDateTime value
        Throws:
        java.sql.SQLException - if column type doesn't permit conversion
      • getInternalOffsetTime

        public java.time.OffsetTime getInternalOffsetTime​(ColumnDefinition columnInfo,
                                                          java.util.TimeZone timeZone)
                                                   throws java.sql.SQLException
        Get OffsetTime from raw binary format.
        Specified by:
        getInternalOffsetTime in class RowProtocol
        Parameters:
        columnInfo - column information
        timeZone - time zone
        Returns:
        OffsetTime value
        Throws:
        java.sql.SQLException - if column type doesn't permit conversion
      • getInternalLocalTime

        public java.time.LocalTime getInternalLocalTime​(ColumnDefinition columnInfo,
                                                        java.util.TimeZone timeZone)
                                                 throws java.sql.SQLException
        Get LocalTime from raw binary format.
        Specified by:
        getInternalLocalTime in class RowProtocol
        Parameters:
        columnInfo - column information
        timeZone - time zone
        Returns:
        LocalTime value
        Throws:
        java.sql.SQLException - if column type doesn't permit conversion
      • getInternalLocalDate

        public java.time.LocalDate getInternalLocalDate​(ColumnDefinition columnInfo,
                                                        java.util.TimeZone timeZone)
                                                 throws java.sql.SQLException
        Get LocalDate from raw binary format.
        Specified by:
        getInternalLocalDate in class RowProtocol
        Parameters:
        columnInfo - column information
        timeZone - time zone
        Returns:
        LocalDate value
        Throws:
        java.sql.SQLException - if column type doesn't permit conversion
      • isBinaryEncoded

        public boolean isBinaryEncoded()
        Indicate if data is binary encoded.
        Specified by:
        isBinaryEncoded in class RowProtocol
        Returns:
        always true.