Class SQL_DATE_STRUCT

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class SQL_DATE_STRUCT
    extends Struct
    implements NativeResource

    Layout

    
     struct SQL_DATE_STRUCT {
         SQLSMALLINT year;
         SQLUSMALLINT month;
         SQLUSMALLINT day;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • YEAR, MONTH, DAY

        The struct member offsets.
    • Constructor Detail

      • SQL_DATE_STRUCT

        public SQL_DATE_STRUCT​(java.nio.ByteBuffer container)
        Creates a SQL_DATE_STRUCT instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • year

        public short year()
        Returns the value of the year field.
      • month

        public short month()
        Returns the value of the month field.
      • day

        public short day()
        Returns the value of the day field.
      • year

        public SQL_DATE_STRUCT year​(short value)
        Sets the specified value to the year field.
      • month

        public SQL_DATE_STRUCT month​(short value)
        Sets the specified value to the month field.
      • day

        public SQL_DATE_STRUCT day​(short value)
        Sets the specified value to the day field.
      • set

        public SQL_DATE_STRUCT set​(short year,
                                   short month,
                                   short day)
        Initializes this struct with the specified values.
      • set

        public SQL_DATE_STRUCT set​(SQL_DATE_STRUCT src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static SQL_DATE_STRUCT malloc()
        Returns a new SQL_DATE_STRUCT instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static SQL_DATE_STRUCT calloc()
        Returns a new SQL_DATE_STRUCT instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static SQL_DATE_STRUCT create​(long address)
        Returns a new SQL_DATE_STRUCT instance for the specified memory address.
      • createSafe

        @Nullable
        public static SQL_DATE_STRUCT createSafe​(long address)
        Like create, but returns null if address is NULL.
      • create

        public static SQL_DATE_STRUCT.Buffer create​(long address,
                                                    int capacity)
        Create a SQL_DATE_STRUCT.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static SQL_DATE_STRUCT.Buffer createSafe​(long address,
                                                        int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static SQL_DATE_STRUCT mallocStack()
        Returns a new SQL_DATE_STRUCT instance allocated on the thread-local MemoryStack.
      • callocStack

        public static SQL_DATE_STRUCT callocStack()
        Returns a new SQL_DATE_STRUCT instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static SQL_DATE_STRUCT mallocStack​(MemoryStack stack)
        Returns a new SQL_DATE_STRUCT instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static SQL_DATE_STRUCT callocStack​(MemoryStack stack)
        Returns a new SQL_DATE_STRUCT instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nyear

        public static short nyear​(long struct)
        Unsafe version of year().
      • nmonth

        public static short nmonth​(long struct)
        Unsafe version of month().
      • nday

        public static short nday​(long struct)
        Unsafe version of day().
      • nyear

        public static void nyear​(long struct,
                                 short value)
        Unsafe version of year.
      • nmonth

        public static void nmonth​(long struct,
                                  short value)
        Unsafe version of month.
      • nday

        public static void nday​(long struct,
                                short value)
        Unsafe version of day.