Package oracle.jdbc

Interface VectorMetaData


  • public interface VectorMetaData
    Metadata for a VECTOR column or parameter.
    Since:
    23.4
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Class<?> arrayClass()
      Returns the preferred array class for conversions of the VECTOR described by this meta data.
      boolean isSparse()
      Returns true if the VECTOR described by this metadata has a SPARSE encoding.
      int length()
      Returns the number of values (ie: dimensions) in the VECTOR described by this metadata, or -1 if the VECTOR has a variable length.
      OracleType type()
      Returns the type of the VECTOR described by this metadata.
    • Method Detail

      • length

        int length()
        Returns the number of values (ie: dimensions) in the VECTOR described by this metadata, or -1 if the VECTOR has a variable length.
        Returns:
        The VECTOR length, or -1.
      • arrayClass

        java.lang.Class<?> arrayClass()

        Returns the preferred array class for conversions of the VECTOR described by this meta data.

        The preferred array class is one that can store all possible values of the VECTOR in the least number of bits without losing information. For instance, a float[] is preferred when converting a VECTOR of FLOAT32 values, and a double[] is preferred when converting a VECTOR of FLOAT64 values.

        A lossless conversion is guaranteed when the preferred array class is provided as the type argument to getObject methods of ResultSet and CallableStatement, or when an instance of the preferred array class is provided as the x argument, along with OracleType.VECTOR as the targetSqlType argument, to setObject methods of PreparedStatement and CallableStatement.

        The setObject and getObject methods may support conversions with alternative array classes. Conversions with alternative array classes may require a narrowing or widening conversion that loses information.

        Returns:
        The preferred array class. Not null.
      • isSparse

        boolean isSparse()
        Returns true if the VECTOR described by this metadata has a SPARSE encoding.
        Returns:
        true if SPARSE, or false if not.