Enum SnowflakeType

  • All Implemented Interfaces:
    Serializable, Comparable<SnowflakeType>

    public enum SnowflakeType
    extends Enum<SnowflakeType>
    Enumeration of Snowflake data types.

    This enum represents the various data types supported by Snowflake. These type values are used in metadata operations such as FieldMetadata.getBase() to describe the underlying type of a field in structured types (OBJECT, ARRAY, MAP).

    Usage Example

    
     import net.snowflake.client.api.resultset.FieldMetadata;
     import net.snowflake.client.api.resultset.SnowflakeType;
    
     // Get field metadata from a structured type column
     FieldMetadata field = resultSetMetaData.getColumnFields(1).get(0);
     SnowflakeType baseType = field.getBase();
    
     if (baseType == SnowflakeType.TEXT) {
         System.out.println("Field is a text type");
     } else if (baseType == SnowflakeType.INTEGER) {
         System.out.println("Field is an integer type");
     }
     
    Additionally, this enum includes JDBC type code extensions for Snowflake-specific data types not covered by Types.

    These constants can be used with PreparedStatement.setObject(int, Object, int) to specify the target SQL type when binding parameters to Snowflake-specific types. *

    Example usage:

    
     PreparedStatement pstmt = connection.prepareStatement("INSERT INTO t VALUES (?)");
     pstmt.setObject(1, myTimestamp, SnowflakeType.EXTRA_TYPES_TIMESTAMP_NTZ);
     
    Since:
    4.0.0
    See Also:
    FieldMetadata
    • Enum Constant Detail

      • ANY

        public static final SnowflakeType ANY
        Represents an ANY type (unspecified/dynamic)
      • ARRAY

        public static final SnowflakeType ARRAY
        Represents an ARRAY type
      • BINARY

        public static final SnowflakeType BINARY
        Represents a BINARY type
      • BOOLEAN

        public static final SnowflakeType BOOLEAN
        Represents a BOOLEAN type
      • CHAR

        public static final SnowflakeType CHAR
        Represents a CHAR type
      • DATE

        public static final SnowflakeType DATE
        Represents a DATE type
      • DECFLOAT

        public static final SnowflakeType DECFLOAT
        Represents a DECFLOAT (decimal floating-point) type
      • FIXED

        public static final SnowflakeType FIXED
        Represents a FIXED-point numeric type (NUMBER with scale)
      • INTEGER

        public static final SnowflakeType INTEGER
        Represents an INTEGER type
      • OBJECT

        public static final SnowflakeType OBJECT
        Represents an OBJECT type (structured)
      • MAP

        public static final SnowflakeType MAP
        Represents a MAP type
      • REAL

        public static final SnowflakeType REAL
        Represents a REAL (floating-point) type
      • TEXT

        public static final SnowflakeType TEXT
        Represents a TEXT/VARCHAR type
      • TIME

        public static final SnowflakeType TIME
        Represents a TIME type
      • TIMESTAMP

        public static final SnowflakeType TIMESTAMP
        Represents a TIMESTAMP type (no timezone)
      • TIMESTAMP_LTZ

        public static final SnowflakeType TIMESTAMP_LTZ
        Represents a TIMESTAMP with local timezone
      • TIMESTAMP_NTZ

        public static final SnowflakeType TIMESTAMP_NTZ
        Represents a TIMESTAMP with no timezone
      • TIMESTAMP_TZ

        public static final SnowflakeType TIMESTAMP_TZ
        Represents a TIMESTAMP with timezone
      • INTERVAL_YEAR_MONTH

        public static final SnowflakeType INTERVAL_YEAR_MONTH
        Represents an INTERVAL YEAR TO MONTH type
      • INTERVAL_DAY_TIME

        public static final SnowflakeType INTERVAL_DAY_TIME
        Represents an INTERVAL DAY TO TIME type
      • VARIANT

        public static final SnowflakeType VARIANT
        Represents a VARIANT (semi-structured) type
      • GEOGRAPHY

        public static final SnowflakeType GEOGRAPHY
        Represents a GEOGRAPHY type
      • GEOMETRY

        public static final SnowflakeType GEOMETRY
        Represents a GEOMETRY type
      • VECTOR

        public static final SnowflakeType VECTOR
        Represents a VECTOR type
    • Method Detail

      • values

        public static SnowflakeType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SnowflakeType c : SnowflakeType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SnowflakeType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null