Class SQL_TIMESTAMP_STRUCT

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SQL_TIMESTAMP_STRUCT extends Struct<SQL_TIMESTAMP_STRUCT> implements NativeResource

 struct SQL_TIMESTAMP_STRUCT {
     SQLSMALLINT year;
     SQLUSMALLINT month;
     SQLUSMALLINT day;
     SQLUSMALLINT hour;
     SQLUSMALLINT minute;
     SQLUSMALLINT second;
     SQLUINTEGER fraction;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • YEAR

      public static final int YEAR
      The struct member offsets.
    • MONTH

      public static final int MONTH
      The struct member offsets.
    • DAY

      public static final int DAY
      The struct member offsets.
    • HOUR

      public static final int HOUR
      The struct member offsets.
    • MINUTE

      public static final int MINUTE
      The struct member offsets.
    • SECOND

      public static final int SECOND
      The struct member offsets.
    • FRACTION

      public static final int FRACTION
      The struct member offsets.
  • Constructor Details

    • SQL_TIMESTAMP_STRUCT

      public SQL_TIMESTAMP_STRUCT(ByteBuffer container)
      Creates a SQL_TIMESTAMP_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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<SQL_TIMESTAMP_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.
    • hour

      public short hour()
      Returns:
      the value of the hour field.
    • minute

      public short minute()
      Returns:
      the value of the minute field.
    • second

      public short second()
      Returns:
      the value of the second field.
    • fraction

      public int fraction()
      Returns:
      the value of the fraction field.
    • year

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

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

      public SQL_TIMESTAMP_STRUCT day(short value)
      Sets the specified value to the day field.
    • hour

      public SQL_TIMESTAMP_STRUCT hour(short value)
      Sets the specified value to the hour field.
    • minute

      public SQL_TIMESTAMP_STRUCT minute(short value)
      Sets the specified value to the minute field.
    • second

      public SQL_TIMESTAMP_STRUCT second(short value)
      Sets the specified value to the second field.
    • fraction

      public SQL_TIMESTAMP_STRUCT fraction(int value)
      Sets the specified value to the fraction field.
    • set

      public SQL_TIMESTAMP_STRUCT set(short year, short month, short day, short hour, short minute, short second, int fraction)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

      public static SQL_TIMESTAMP_STRUCT create()
      Returns a new SQL_TIMESTAMP_STRUCT instance allocated with BufferUtils.
    • create

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

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

      public static SQL_TIMESTAMP_STRUCT.Buffer malloc(int capacity)
      Returns a new SQL_TIMESTAMP_STRUCT.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static SQL_TIMESTAMP_STRUCT.Buffer calloc(int capacity)
      Returns a new SQL_TIMESTAMP_STRUCT.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SQL_TIMESTAMP_STRUCT.Buffer create(int capacity)
      Returns a new SQL_TIMESTAMP_STRUCT.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

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

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

      public static SQL_TIMESTAMP_STRUCT malloc(MemoryStack stack)
      Returns a new SQL_TIMESTAMP_STRUCT instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

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

      public static SQL_TIMESTAMP_STRUCT.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new SQL_TIMESTAMP_STRUCT.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static SQL_TIMESTAMP_STRUCT.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new SQL_TIMESTAMP_STRUCT.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      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().
    • nhour

      public static short nhour(long struct)
      Unsafe version of hour().
    • nminute

      public static short nminute(long struct)
      Unsafe version of minute().
    • nsecond

      public static short nsecond(long struct)
      Unsafe version of second().
    • nfraction

      public static int nfraction(long struct)
      Unsafe version of fraction().
    • 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.
    • nhour

      public static void nhour(long struct, short value)
      Unsafe version of hour.
    • nminute

      public static void nminute(long struct, short value)
      Unsafe version of minute.
    • nsecond

      public static void nsecond(long struct, short value)
      Unsafe version of second.
    • nfraction

      public static void nfraction(long struct, int value)
      Unsafe version of fraction.