Package net.snowflake.client.api.driver
Class SnowflakeDriver
- java.lang.Object
-
- net.snowflake.client.api.driver.SnowflakeDriver
-
- All Implemented Interfaces:
Driver
- Direct Known Subclasses:
SnowflakeDriver
public class SnowflakeDriver extends Object implements Driver
JDBC Driver implementation for Snowflake.To use this driver, specify the following URL formats:
jdbc:snowflake://host:port- Standard connectionjdbc:snowflake:auto- Auto-configuration from connections.toml
The driver is automatically registered with
DriverManagerwhen loaded.- See Also:
Driver
-
-
Field Summary
Fields Modifier and Type Field Description static PropertiesEMPTY_PROPERTIESstatic SnowflakeDriverINSTANCE
-
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 Snowflake JDBC format.Connectionconnect()Establishes a connection using auto-configuration.Connectionconnect(String url, Properties info)Establishes a connection to the Snowflake database.static StringgetImplementationVersion()Gets driver version information for telemetry and logging.intgetMajorVersion()intgetMinorVersion()LoggergetParentLogger()longgetPatchVersion()Gets the driver patch version number.DriverPropertyInfo[]getPropertyInfo(String url, Properties info)booleanjdbcCompliant()
-
-
-
Field Detail
-
INSTANCE
public static final SnowflakeDriver INSTANCE
-
EMPTY_PROPERTIES
public static final Properties EMPTY_PROPERTIES
-
-
Method Detail
-
acceptsURL
public boolean acceptsURL(String url)
Checks whether a given URL is in a valid Snowflake JDBC format.Valid formats:
jdbc:snowflake://host[:port]- Standard connectionjdbc:snowflake:auto- Auto-configuration
- Specified by:
acceptsURLin interfaceDriver- Parameters:
url- the database URL- Returns:
- true if the URL is valid and accepted by this driver
-
connect
public Connection connect(String url, Properties info) throws SQLException
Establishes a connection to the Snowflake database.- Specified by:
connectin interfaceDriver- Parameters:
url- the database URLinfo- additional connection properties- Returns:
- a Connection object, or null if the URL is not accepted
- Throws:
SQLException- if a database access error occurs
-
connect
public Connection connect() throws SQLException
Establishes a connection using auto-configuration.- Returns:
- a Connection object
- Throws:
SQLException- if a database access error occurs
-
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersionin interfaceDriver
-
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersionin interfaceDriver
-
getPatchVersion
public long getPatchVersion()
Gets the driver patch version number. This is not part of the standard JDBC Driver interface, but is needed for full version information.- Returns:
- driver patch version number
-
getImplementationVersion
public static String getImplementationVersion()
Gets driver version information for telemetry and logging.- Returns:
- full version string (e.g., "4.0.0")
-
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()
- Specified by:
getParentLoggerin interfaceDriver
-
-