net.snowflake.client.jdbc

## Class DefaultSFConnectionHandler

- java.lang.Object
- - net.snowflake.client.jdbc.DefaultSFConnectionHandler

All Implemented Interfaces:
  SFConnectionHandler

    public class DefaultSFConnectionHandler
    extends Object
    implements SFConnectionHandler

The default ConnectionHandler used by SnowflakeConnectionV(x). Unless a separate implementation is provided, a DefaultConnectionHandler will be constructed automatically by the Connection class.

### Constructor Summary

Constructors
Constructor and Description
`DefaultSFConnectionHandler(SnowflakeConnectString conStr)` Constructs a DefaultConnectionHandler using a SnowflakeConnectString.
`DefaultSFConnectionHandler(SnowflakeConnectString conStr, boolean skipOpen)` Constructs a DefaultConnectionHandler using a SnowflakeConnectString.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`SnowflakeBaseResultSet` `createAsyncResultSet(SFBaseResultSet resultSet, Statement statement)` Creates an asynchronous result set from a base SFBaseResultSet for this connection implementation.
`SnowflakeBaseResultSet` `createResultSet(SFBaseResultSet resultSet, Statement statement)` Creates a SnowflakeResultSet from a base SFBaseResultSet for this connection implementation.
`ResultSet` `createResultSet(String queryID, Statement statement)` Creates a result set from a query id.
`SFBaseFileTransferAgent` `getFileTransferAgent(String command, SFBaseStatement statement)`
`SFBaseSession` `getSFSession()` Returns the default SFSession client implementation.
`SFBaseStatement` `getSFStatement()` Returns the default SFStatement client implementation.
`protected void` `initialize(SnowflakeConnectString conStr, String appID, String appVersion)`
`void` `initializeConnection(String url, Properties info)` Initializes the SnowflakeConnection
`static Map<String,Object>` `mergeProperties(SnowflakeConnectString conStr)` Processes parameters given in the connection string.
`boolean` `supportsAsyncQuery()` Whether this Connection supports asynchronous queries.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.snowflake.client.jdbc.SFConnectionHandler

`getBindStageName`

### Constructor Detail

#### DefaultSFConnectionHandler

    public DefaultSFConnectionHandler(SnowflakeConnectString conStr)

Constructs a DefaultConnectionHandler using a SnowflakeConnectString. This can be done by using SnowflakeConnectString.parse(url, info), where url is a connection url and info is a java.util.Properties

Parameters:
  `conStr` - A SnowflakeConnectString object

#### DefaultSFConnectionHandler

    public DefaultSFConnectionHandler(SnowflakeConnectString conStr,
                                      boolean skipOpen)

Constructs a DefaultConnectionHandler using a SnowflakeConnectString. This can be done by using SnowflakeConnectString.parse(url, info), where url is a connection url and info is a java.util.Properties

Parameters:
  `conStr` - A SnowflakeConnectString object
  `skipOpen` - Skip calling open() on the session (for test-use only)

### Method Detail

#### mergeProperties

    public static Map<String,Object> mergeProperties(SnowflakeConnectString conStr)

Processes parameters given in the connection string. This extracts accountName, databaseName, schemaName from the URL if it is specified there.

Parameters:
  `conStr` - Connection string object

#### supportsAsyncQuery

    public boolean supportsAsyncQuery()

Description copied from interface: `SFConnectionHandler`
Whether this Connection supports asynchronous queries. If yes, createAsyncResultSet may be called.

Specified by:
  `supportsAsyncQuery` in interface `SFConnectionHandler`

#### initializeConnection

    public void initializeConnection(String url,
                                     Properties info)
                              throws SQLException

Description copied from interface: `SFConnectionHandler`
Initializes the SnowflakeConnection

Specified by:
  `initializeConnection` in interface `SFConnectionHandler`
Throws:
  `SQLException`

#### getSFSession

    public SFBaseSession getSFSession()

Returns the default SFSession client implementation.

Specified by:
  `getSFSession` in interface `SFConnectionHandler`

#### getSFStatement

    public SFBaseStatement getSFStatement()

Returns the default SFStatement client implementation.

Specified by:
  `getSFStatement` in interface `SFConnectionHandler`

#### initialize

    protected void initialize(SnowflakeConnectString conStr,
                              String appID,
                              String appVersion)
                       throws SQLException

Throws:
  `SQLException`

#### createResultSet

    public ResultSet createResultSet(String queryID,
                                     Statement statement)
                              throws SQLException

Description copied from interface: `SFConnectionHandler`
Creates a result set from a query id.

Specified by:
  `createResultSet` in interface `SFConnectionHandler`
Throws:
  `SQLException`

#### createResultSet

    public SnowflakeBaseResultSet createResultSet(SFBaseResultSet resultSet,
                                                  Statement statement)
                                           throws SQLException

Description copied from interface: `SFConnectionHandler`
Creates a SnowflakeResultSet from a base SFBaseResultSet for this connection implementation.

Specified by:
  `createResultSet` in interface `SFConnectionHandler`
Throws:
  `SQLException`

#### createAsyncResultSet

    public SnowflakeBaseResultSet createAsyncResultSet(SFBaseResultSet resultSet,
                                                       Statement statement)
                                                throws SQLException

Description copied from interface: `SFConnectionHandler`
Creates an asynchronous result set from a base SFBaseResultSet for this connection implementation.

Specified by:
  `createAsyncResultSet` in interface `SFConnectionHandler`
Throws:
  `SQLException`

#### getFileTransferAgent

    public SFBaseFileTransferAgent getFileTransferAgent(String command,
                                                        SFBaseStatement statement)
                                                 throws SQLNonTransientConnectionException,
                                                        SnowflakeSQLException

Specified by:
  `getFileTransferAgent` in interface `SFConnectionHandler`
Parameters:
  `command` - The command to parse for this file transfer (e.g., PUT/GET)
  `statement` - The statement to use for this file transfer
Throws:
  `SQLNonTransientConnectionException`
  `SnowflakeSQLException`