Package net.snowflake.client.jdbc
Class SnowflakeDriver
- java.lang.Object
-
- net.snowflake.client.jdbc.SnowflakeDriver
-
- All Implemented Interfaces:
Driver
- Direct Known Subclasses:
SnowflakeDriver
public class SnowflakeDriver extends Object implements Driver
JDBC Driver implementation of Snowflake for production. To use this driver, specify the following URL: jdbc:snowflake://host:portNote: don't add logger to this class since logger init will potentially break driver class loading
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTO_CONNECTION_STRING_PREFIXprotected static booleandisableIncidentsstatic PropertiesEMPTY_PROPERTIESstatic StringimplementVersion
-
Constructor Summary
Constructors Constructor Description SnowflakeDriver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsURL(String url)Checks whether a given url is in a valid format.Connectionconnect()Connect method using connection configuration fileConnectionconnect(String url, Properties info)Connect methodstatic StringgetDisableArrowResultFormatMessage()static StringgetImplementationTitle()Utility method to verify if the standard or fips snowflake-jdbc driver is being used.static StringgetJdbcJarname()Utility method to get the complete jar name with version.intgetMajorVersion()intgetMinorVersion()LoggergetParentLogger()DriverPropertyInfo[]getPropertyInfo(String url, Properties info)static booleanisDisableArrowResultFormat()static booleanisDisableIncidents()booleanjdbcCompliant()static voidmain(String[] args)static voidsetDisableIncidents(boolean throttleIncidents)
-
-
-
Field Detail
-
AUTO_CONNECTION_STRING_PREFIX
public static final String AUTO_CONNECTION_STRING_PREFIX
- See Also:
- Constant Field Values
-
EMPTY_PROPERTIES
public static final Properties EMPTY_PROPERTIES
-
implementVersion
public static String implementVersion
-
disableIncidents
protected static boolean disableIncidents
-
-
Method Detail
-
isDisableArrowResultFormat
public static boolean isDisableArrowResultFormat()
-
getDisableArrowResultFormatMessage
public static String getDisableArrowResultFormatMessage()
-
getImplementationTitle
public static String getImplementationTitle()
Utility method to verify if the standard or fips snowflake-jdbc driver is being used.- Returns:
- the title of the implementation, null is returned if it is not known.
-
getJdbcJarname
public static String getJdbcJarname()
Utility method to get the complete jar name with version.- Returns:
- the jar name with version
-
acceptsURL
public boolean acceptsURL(String url)
Checks whether a given url is in a valid format.The current uri format is: jdbc:snowflake://[host[:port]] or jdbc:snowflake:auto
jdbc:snowflake:// - run in embedded mode jdbc:snowflake://localhost - connect to localhost default port (8080)
jdbc:snowflake://localhost:8080- connect to localhost port 8080
jdbc:snowflake:auto - use connections.toml
- Specified by:
acceptsURLin interfaceDriver- Parameters:
url- url of the database including host and port- Returns:
- true if the url is valid
-
connect
public Connection connect(String url, Properties info) throws SQLException
Connect method- Specified by:
connectin interfaceDriver- Parameters:
url- jdbc urlinfo- addition info for passing database/schema names- Returns:
- connection
- Throws:
SQLException- if failed to create a snowflake connection
-
connect
@SnowflakeJdbcInternalApi public Connection connect() throws SQLException
Connect method using connection configuration file- Returns:
- connection
- Throws:
SQLException- if failed to create a snowflake connection
-
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersionin interfaceDriver
-
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersionin interfaceDriver
-
getPropertyInfo
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
- Specified by:
getPropertyInfoin interfaceDriver- Throws:
SQLException
-
jdbcCompliant
public boolean jdbcCompliant()
- Specified by:
jdbcCompliantin interfaceDriver
-
getParentLogger
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
getParentLoggerin interfaceDriver- Throws:
SQLFeatureNotSupportedException
-
isDisableIncidents
public static boolean isDisableIncidents()
-
setDisableIncidents
public static void setDisableIncidents(boolean throttleIncidents)
-
main
public static final void main(String[] args)
-
-