public class SnowflakeUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BIG_DECIMAL_STR |
static String |
BOOLEAN_STR |
static String |
BYTE_STR |
static String |
BYTES_STR |
static String |
DATE_STR |
static String |
DOUBLE_STR |
static int |
EXTRA_TYPES_TIMESTAMP_LTZ
Additional data types not covered by standard JDBC
|
static int |
EXTRA_TYPES_TIMESTAMP_TZ |
static String |
FLOAT_STR |
static String |
INT_STR |
static String |
LONG_STR |
static String |
SHORT_STR |
static String |
TIME_STR |
static String |
TIMESTAMP_STR |
| Constructor and Description |
|---|
SnowflakeUtil() |
| Modifier and Type | Method and Description |
|---|---|
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,
SFSession session) |
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) |
static void |
setupProxyPropertiesIfNecessary(Properties info)
Setup JDBC proxy properties if necessary.
|
static String |
systemGetEnv(String env)
System.getenv wrapper.
|
static String |
systemGetProperty(String property)
System.getProperty wrapper.
|
public static final int EXTRA_TYPES_TIMESTAMP_LTZ
public static final int EXTRA_TYPES_TIMESTAMP_TZ
public static final String BIG_DECIMAL_STR
public static final String FLOAT_STR
public static final String DOUBLE_STR
public static final String BOOLEAN_STR
public static final String SHORT_STR
public static final String INT_STR
public static final String LONG_STR
public static final String TIME_STR
public static final String TIMESTAMP_STR
public static final String DATE_STR
public static final String BYTE_STR
public static final String BYTES_STR
public static void checkErrorAndThrowExceptionIncludingReauth(com.fasterxml.jackson.databind.JsonNode rootNode)
throws SnowflakeSQLException
SnowflakeSQLExceptionpublic static void checkErrorAndThrowException(com.fasterxml.jackson.databind.JsonNode rootNode)
throws SnowflakeSQLException
SnowflakeSQLExceptionpublic static SnowflakeColumnMetadata extractColumnMetadata(com.fasterxml.jackson.databind.JsonNode colNode, boolean jdbcTreatDecimalAsInt, SFSession session) throws SnowflakeSQLException
SnowflakeSQLExceptionpublic static void logResponseDetails(org.apache.http.HttpResponse response,
SFLogger logger)
Used when there is an error in http response
response - http response get from serverlogger - logger objectpublic static ThreadPoolExecutor createDefaultExecutorService(String threadNamePrefix, int parallel)
threadNamePrefix - prefix of the thread nameparallel - the number of concurrencypublic static boolean isBlank(String input)
public static String randomAlphaNumeric(int count)
public static String systemGetProperty(String property)
property - the property namepublic static String systemGetEnv(String env)
env - the environment variable name.public static void setupProxyPropertiesIfNecessary(Properties info) throws SnowflakeSQLException
info - proxy server properties.SnowflakeSQLExceptionCopyright © 2020. All rights reserved.