net.snowflake.client.jdbc

## Class SnowflakeUtil

- java.lang.Object
- - net.snowflake.client.jdbc.SnowflakeUtil

    public class SnowflakeUtil
    extends Object

Author:
  jhuang

### Field Summary

Fields
`static int` `EXTRA_TYPES_TIMESTAMP_LTZ` Additional data types not covered by standard JDBC
`static int` `EXTRA_TYPES_TIMESTAMP_TZ`

### Constructor Summary

Constructors
Constructor and Description
`SnowflakeUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `checkErrorAndThrowException(com.fasterxml.jackson.databind.JsonNode rootNode)`
`static void` `checkErrorAndThrowExceptionIncludingReauth(com.fasterxml.jackson.databind.JsonNode rootNode)`
`static ThreadPoolExecutor` `createDefaultExecutorService(String threadNamePrefix, int parallel)` Returns a new thread pool configured with the default settings.
`static SnowflakeColumnMetadata` `extractColumnMetadata(com.fasterxml.jackson.databind.JsonNode colNode, boolean jdbcTreatDecimalAsInt)`
`static Throwable` `getRootCause(Exception ex)`
`static boolean` `isBlank(String input)`
`static void` `logResponseDetails(org.apache.http.HttpResponse response, SFLogger logger)` A utility to log response details.
`static String` `randomAlphaNumeric(int count)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### EXTRA_TYPES_TIMESTAMP_LTZ

    public static final int EXTRA_TYPES_TIMESTAMP_LTZ

Additional data types not covered by standard JDBC

See Also:
  Constant Field Values

#### EXTRA_TYPES_TIMESTAMP_TZ

    public static final int EXTRA_TYPES_TIMESTAMP_TZ

See Also:
  Constant Field Values

### Constructor Detail

#### SnowflakeUtil

    public SnowflakeUtil()

### Method Detail

#### checkErrorAndThrowExceptionIncludingReauth

    public static void checkErrorAndThrowExceptionIncludingReauth(com.fasterxml.jackson.databind.JsonNode rootNode)
                                                           throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### checkErrorAndThrowException

    public static void checkErrorAndThrowException(com.fasterxml.jackson.databind.JsonNode rootNode)
                                            throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### extractColumnMetadata

    public static SnowflakeColumnMetadata extractColumnMetadata(com.fasterxml.jackson.databind.JsonNode colNode,
                                                                boolean jdbcTreatDecimalAsInt)
                                                         throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### logResponseDetails

    public static void logResponseDetails(org.apache.http.HttpResponse response,
                                          SFLogger logger)

A utility to log response details.

Used when there is an error in http response

Parameters:
  `response` - http response get from server
  `logger` - logger object

#### createDefaultExecutorService

    public static ThreadPoolExecutor createDefaultExecutorService(String threadNamePrefix,
                                                                  int parallel)

Returns a new thread pool configured with the default settings.

Parameters:
  `threadNamePrefix` - prefix of the thread name
  `parallel` - the number of concurrency
Returns:
  A new thread pool configured with the default settings.

#### getRootCause

    public static Throwable getRootCause(Exception ex)

#### isBlank

    public static boolean isBlank(String input)

#### randomAlphaNumeric

    public static String randomAlphaNumeric(int count)