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_NTZ |
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 HttpClientSettingsKey |
convertProxyPropertiesToHttpClientKey(OCSPMode mode,
Properties info)
Setup JDBC proxy properties if necessary.
|
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,
SFBaseSession session) |
static Throwable |
getRootCause(Exception ex) |
static long |
getSecondsFromMillis(long millis)
Round the time value from milliseconds to seconds so the seconds can be used to create
SimpleDateFormatter.
|
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 String |
systemGetEnv(String env)
System.getenv wrapper.
|
static String |
systemGetProperty(String property)
System.getProperty wrapper.
|
static void |
systemSetEnv(String key,
String value)
System.setEnv function.
|
static void |
systemUnsetEnv(String key)
System.unsetEnv function to remove a system environment parameter in the map
|
public static final int EXTRA_TYPES_TIMESTAMP_LTZ
public static final int EXTRA_TYPES_TIMESTAMP_TZ
public static final int EXTRA_TYPES_TIMESTAMP_NTZ
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, SFBaseSession 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 systemSetEnv(String key, String value)
public static void systemUnsetEnv(String key)
key - public static HttpClientSettingsKey convertProxyPropertiesToHttpClientKey(OCSPMode mode, Properties info) throws SnowflakeSQLException
mode - OCSP modeinfo - proxy server properties.SnowflakeSQLExceptionpublic static long getSecondsFromMillis(long millis)
millis - Copyright © 2022. All rights reserved.