Package net.snowflake.client.api.datasource

## Interface SnowflakeDataSource

All Superinterfaces:
  `CommonDataSource`, `DataSource`, `Wrapper`

All Known Subinterfaces:
  `SnowflakeConnectionPoolDataSource`

    public interface SnowflakeDataSource
    extends DataSource

Snowflake-specific extension of `DataSource` that provides configuration methods for Snowflake JDBC connections.

Use `SnowflakeDataSourceFactory` to create instances of this interface.

Example usage:

     SnowflakeDataSource ds = SnowflakeDataSourceFactory.createDataSource();
     ds.setAccount("myaccount");
     ds.setUser("myuser");
     ds.setPassword("mypassword");
     ds.setDatabase("mydb");
     ds.setSchema("myschema");
     ds.setWarehouse("mywh");

     try (Connection conn = ds.getConnection()) {
       // use connection
     }

See Also:
  `SnowflakeDataSourceFactory`

### Method Summary

All Methods Instance Methods Abstract Methods
`Properties` `getProperties()` Gets the connection properties.
`String` `getUrl()` Gets the JDBC URL.
`void` `setAccount​(String account)` Sets the account identifier.
`void` `setAllowUnderscoresInHost​(boolean allowUnderscoresInHost)` Sets whether to allow underscores in hostnames.
`void` `setApplication​(String application)` Sets the application name.
`void` `setArrowTreatDecimalAsInt​(boolean treatDecimalAsInt)` Sets whether to treat Arrow DECIMAL columns as INT.
`void` `setAuthenticator​(String authenticator)` Sets the authenticator type (e.g., "snowflake", "externalbrowser", "oauth").
`void` `setBrowserResponseTimeout​(int seconds)` Sets the browser response timeout in seconds for external browser authentication.
`void` `setClientConfigFile​(String clientConfigFile)` Sets the client configuration file path.
`void` `setDatabaseName​(String databaseName)` Sets the database name.
`void` `setDiagnosticsAllowlistFile​(String diagnosticsAllowlistFile)` Sets the diagnostics allowlist file path.
`void` `setDisableGcsDefaultCredentials​(boolean isGcsDefaultCredentialsDisabled)` Sets whether to disable GCS default credentials.
`void` `setDisableSamlURLCheck​(boolean disableSamlURLCheck)` Sets whether to disable SAML URL validation.
`void` `setDisableSocksProxy​(boolean ignoreJvmSocksProxy)` Sets whether to disable SOCKS proxy.
`void` `setEnableClientRequestMfaToken​(boolean enableClientRequestMfaToken)` Sets whether to enable client-side MFA token request.
`void` `setEnableClientStoreTemporaryCredential​(boolean enableClientStoreTemporaryCredential)` Sets whether to enable client-side storage of temporary credentials.
`void` `setEnableDiagnostics​(boolean enableDiagnostics)` Sets whether to enable diagnostics.
`void` `setEnablePatternSearch​(boolean enablePatternSearch)` Sets whether to enable pattern search in metadata queries.
`void` `setEnablePutGet​(boolean enablePutGet)` Sets whether to enable PUT/GET commands.
`void` `setGetDateUseNullTimezone​(Boolean getDateUseNullTimezone)` Sets whether getDate should use null timezone.
`void` `setHttpHeadersCustomizers​(List<HttpHeadersCustomizer> httpHeadersCustomizers)` Sets custom HTTP header customizers.
`void` `setJDBCDefaultFormatDateWithTimezone​(Boolean jdbcDefaultFormatDateWithTimezone)` Sets the default date format with timezone for JDBC.
`void` `setMaxHttpRetries​(int maxHttpRetries)` Sets the maximum number of HTTP retries.
`void` `setNetworkTimeout​(int networkTimeoutSeconds)` Sets the network timeout in seconds.
`void` `setNonProxyHosts​(String nonProxyHosts)` Sets non-proxy hosts pattern.
`void` `setOcspFailOpen​(boolean ocspFailOpen)` Sets whether OCSP checking should fail open.
`void` `setPasscode​(String passcode)` Sets the passcode for MFA authentication.
`void` `setPasscodeInPassword​(boolean isPasscodeInPassword)` Sets whether the passcode is included in the password for MFA authentication.
`void` `setPassword​(String password)` Sets the password.
`void` `setPortNumber​(int portNumber)` Sets the port number.
`void` `setPrivateKey​(PrivateKey privateKey)` Sets the private key for key-pair authentication.
`void` `setPrivateKeyBase64​(String privateKeyBase64, String password)` Sets the Base64-encoded private key and optional password for key-pair authentication.
`void` `setPrivateKeyFile​(String location, String password)` Sets the private key file location and optional password for key-pair authentication.
`void` `setProxyHost​(String proxyHost)` Sets the proxy host.
`void` `setProxyPassword​(String proxyPassword)` Sets the proxy password.
`void` `setProxyPort​(int proxyPort)` Sets the proxy port.
`void` `setProxyProtocol​(String proxyProtocol)` Sets the proxy protocol (e.g., "http", "https").
`void` `setProxyUser​(String proxyUser)` Sets the proxy user.
`void` `setPutGetMaxRetries​(int putGetMaxRetries)` Sets the maximum number of PUT/GET retries.
`void` `setQueryTimeout​(int queryTimeoutSeconds)` Sets the query timeout in seconds.
`void` `setRole​(String role)` Sets the role name.
`void` `setSchema​(String schema)` Sets the schema name.
`void` `setServerName​(String serverName)` Sets the server name (hostname).
`void` `setSsl​(boolean ssl)` Sets whether to use SSL (default: true).
`void` `setStringsQuotedForColumnDef​(boolean stringsQuotedForColumnDef)` Sets whether strings are quoted in column definitions.
`void` `setToken​(String token)` Sets the token for OAuth/PAT authentication.
`void` `setTracing​(String tracing)` Sets the tracing level.
`void` `setUrl​(String url)` Sets the JDBC URL for the connection.
`void` `setUseProxy​(boolean useProxy)` Sets whether to use a proxy.
`void` `setUser​(String user)` Sets the user name.
`void` `setWarehouse​(String warehouse)` Sets the warehouse name.

### Methods inherited from interface javax.sql.CommonDataSource

`createShardingKeyBuilder, getParentLogger`

### Methods inherited from interface javax.sql.DataSource

`createConnectionBuilder, getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter`

### Methods inherited from interface java.sql.Wrapper

`isWrapperFor, unwrap`

### Method Detail

#### setUrl

    void setUrl​(String url)

Sets the JDBC URL for the connection.

#### setDatabaseName

    void setDatabaseName​(String databaseName)

Sets the database name.

#### setSchema

    void setSchema​(String schema)

Sets the schema name.

#### setWarehouse

    void setWarehouse​(String warehouse)

Sets the warehouse name.

#### setRole

    void setRole​(String role)

Sets the role name.

#### setUser

    void setUser​(String user)

Sets the user name.

#### setServerName

    void setServerName​(String serverName)

Sets the server name (hostname).

#### setPassword

    void setPassword​(String password)

Sets the password.

#### setPortNumber

    void setPortNumber​(int portNumber)

Sets the port number.

#### setAccount

    void setAccount​(String account)

Sets the account identifier.

#### setSsl

    void setSsl​(boolean ssl)

Sets whether to use SSL (default: true).

#### setAuthenticator

    void setAuthenticator​(String authenticator)

Sets the authenticator type (e.g., "snowflake", "externalbrowser", "oauth").

#### setToken

    void setToken​(String token)

Sets the token for OAuth/PAT authentication.

#### getUrl

    String getUrl()

Gets the JDBC URL.

#### setPrivateKey

    void setPrivateKey​(PrivateKey privateKey)

Sets the private key for key-pair authentication.

#### setPrivateKeyFile

    void setPrivateKeyFile​(String location,
                           String password)

Sets the private key file location and optional password for key-pair authentication.

#### setPrivateKeyBase64

    void setPrivateKeyBase64​(String privateKeyBase64,
                             String password)

Sets the Base64-encoded private key and optional password for key-pair authentication.

#### setTracing

    void setTracing​(String tracing)

Sets the tracing level.

#### getProperties

    Properties getProperties()

Gets the connection properties.

#### setAllowUnderscoresInHost

    void setAllowUnderscoresInHost​(boolean allowUnderscoresInHost)

Sets whether to allow underscores in hostnames.

#### setDisableGcsDefaultCredentials

    void setDisableGcsDefaultCredentials​(boolean isGcsDefaultCredentialsDisabled)

Sets whether to disable GCS default credentials.

#### setDisableSamlURLCheck

    void setDisableSamlURLCheck​(boolean disableSamlURLCheck)

Sets whether to disable SAML URL validation.

#### setPasscode

    void setPasscode​(String passcode)

Sets the passcode for MFA authentication.

#### setPasscodeInPassword

    void setPasscodeInPassword​(boolean isPasscodeInPassword)

Sets whether the passcode is included in the password for MFA authentication.

#### setDisableSocksProxy

    void setDisableSocksProxy​(boolean ignoreJvmSocksProxy)

Sets whether to disable SOCKS proxy.

#### setNonProxyHosts

    void setNonProxyHosts​(String nonProxyHosts)

Sets non-proxy hosts pattern.

#### setProxyHost

    void setProxyHost​(String proxyHost)

Sets the proxy host.

#### setProxyPassword

    void setProxyPassword​(String proxyPassword)

Sets the proxy password.

#### setProxyPort

    void setProxyPort​(int proxyPort)

Sets the proxy port.

#### setProxyProtocol

    void setProxyProtocol​(String proxyProtocol)

Sets the proxy protocol (e.g., "http", "https").

#### setProxyUser

    void setProxyUser​(String proxyUser)

Sets the proxy user.

#### setUseProxy

    void setUseProxy​(boolean useProxy)

Sets whether to use a proxy.

#### setNetworkTimeout

    void setNetworkTimeout​(int networkTimeoutSeconds)

Sets the network timeout in seconds.

#### setQueryTimeout

    void setQueryTimeout​(int queryTimeoutSeconds)

Sets the query timeout in seconds.

#### setApplication

    void setApplication​(String application)

Sets the application name.

#### setClientConfigFile

    void setClientConfigFile​(String clientConfigFile)

Sets the client configuration file path.

#### setEnablePatternSearch

    void setEnablePatternSearch​(boolean enablePatternSearch)

Sets whether to enable pattern search in metadata queries.

#### setEnablePutGet

    void setEnablePutGet​(boolean enablePutGet)

Sets whether to enable PUT/GET commands.

#### setArrowTreatDecimalAsInt

    void setArrowTreatDecimalAsInt​(boolean treatDecimalAsInt)

Sets whether to treat Arrow DECIMAL columns as INT.

#### setMaxHttpRetries

    void setMaxHttpRetries​(int maxHttpRetries)

Sets the maximum number of HTTP retries.

#### setOcspFailOpen

    void setOcspFailOpen​(boolean ocspFailOpen)

Sets whether OCSP checking should fail open.

#### setPutGetMaxRetries

    void setPutGetMaxRetries​(int putGetMaxRetries)

Sets the maximum number of PUT/GET retries.

#### setStringsQuotedForColumnDef

    void setStringsQuotedForColumnDef​(boolean stringsQuotedForColumnDef)

Sets whether strings are quoted in column definitions.

#### setEnableDiagnostics

    void setEnableDiagnostics​(boolean enableDiagnostics)

Sets whether to enable diagnostics.

#### setDiagnosticsAllowlistFile

    void setDiagnosticsAllowlistFile​(String diagnosticsAllowlistFile)

Sets the diagnostics allowlist file path.

#### setJDBCDefaultFormatDateWithTimezone

    void setJDBCDefaultFormatDateWithTimezone​(Boolean jdbcDefaultFormatDateWithTimezone)

Sets the default date format with timezone for JDBC.

#### setGetDateUseNullTimezone

    void setGetDateUseNullTimezone​(Boolean getDateUseNullTimezone)

Sets whether getDate should use null timezone.

#### setEnableClientRequestMfaToken

    void setEnableClientRequestMfaToken​(boolean enableClientRequestMfaToken)

Sets whether to enable client-side MFA token request.

#### setEnableClientStoreTemporaryCredential

    void setEnableClientStoreTemporaryCredential​(boolean enableClientStoreTemporaryCredential)

Sets whether to enable client-side storage of temporary credentials.

#### setBrowserResponseTimeout

    void setBrowserResponseTimeout​(int seconds)

Sets the browser response timeout in seconds for external browser authentication.

#### setHttpHeadersCustomizers

    void setHttpHeadersCustomizers​(List<HttpHeadersCustomizer> httpHeadersCustomizers)

Sets custom HTTP header customizers.