Package net.snowflake.client.jdbc
Interface SFConnectionHandler
-
- All Known Implementing Classes:
DefaultSFConnectionHandler
public interface SFConnectionHandlerClass that presents the implementation of a Snowflake Connection. This allows for alternate definitions of SFSession, SFStatement, and SFResultSet, (representing the 'physical' implementation layer) that can share high-level code.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SnowflakeBaseResultSetcreateAsyncResultSet(SFBaseResultSet resultSet, Statement statement)Creates an asynchronous result set from a base SFBaseResultSet for this connection implementation.ResultSetcreateResultSet(String queryID, Statement statement)Creates a result set from a query id.SnowflakeBaseResultSetcreateResultSet(SFBaseResultSet resultSet, Statement statement)default StringgetBindStageName()Overridable method that allows for different connection implementations to use different stage names for binds uploads.SFBaseFileTransferAgentgetFileTransferAgent(String command, SFBaseStatement statement)SFBaseSessiongetSFSession()SFBaseStatementgetSFStatement()voidinitializeConnection(String url, Properties info)Initializes the SnowflakeConnectionbooleansupportsAsyncQuery()
-
-
-
Method Detail
-
supportsAsyncQuery
boolean supportsAsyncQuery()
- Returns:
- Whether this Connection supports asynchronous queries. If yes, createAsyncResultSet may be called.
-
initializeConnection
void initializeConnection(String url, Properties info) throws SQLException
Initializes the SnowflakeConnection- Parameters:
url- url stringinfo- connection parameters- Throws:
SQLException- if any error is encountered
-
getSFSession
SFBaseSession getSFSession()
- Returns:
- Gets the SFBaseSession implementation for this connection implementation
-
getSFStatement
SFBaseStatement getSFStatement() throws SQLException
- Returns:
- Returns the SFStatementInterface implementation for this connection implementation
- Throws:
SQLException- if any error occurs
-
createResultSet
ResultSet createResultSet(String queryID, Statement statement) throws SQLException
Creates a result set from a query id.- Parameters:
queryID- the query IDstatement- Statement object- Returns:
- ResultSet
- Throws:
SQLException- if any error occurs
-
createResultSet
SnowflakeBaseResultSet createResultSet(SFBaseResultSet resultSet, Statement statement) throws SQLException
- Parameters:
resultSet- SFBaseResultSetstatement- Statement- Returns:
- Creates a SnowflakeResultSet from a base SFBaseResultSet for this connection implementation.
- Throws:
SQLException- if an error occurs
-
createAsyncResultSet
SnowflakeBaseResultSet createAsyncResultSet(SFBaseResultSet resultSet, Statement statement) throws SQLException
Creates an asynchronous result set from a base SFBaseResultSet for this connection implementation.- Parameters:
resultSet- SFBaseResultSetstatement- Statement- Returns:
- An asynchronous result set from SFBaseResultSet
- Throws:
SQLException- if an error occurs
-
getFileTransferAgent
SFBaseFileTransferAgent getFileTransferAgent(String command, SFBaseStatement statement) throws SQLNonTransientConnectionException, SnowflakeSQLException
- Parameters:
command- The command to parse for this file transfer (e.g., PUT/GET)statement- The statement to use for this file transfer- Returns:
- SFBaseFileTransferAgent
- Throws:
SQLNonTransientConnectionException- if a connection error occursSnowflakeSQLException- if any other exception occurs
-
getBindStageName
default String getBindStageName()
Overridable method that allows for different connection implementations to use different stage names for binds uploads. By default, it uses SYSTEM$BIND- Returns:
- The name of the identifier with which a temporary stage is created in the Session for uploading array bind values.
-
-