Package 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 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 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)SFBaseFileTransferAgentgetFileTransferAgent(String command, SFBaseStatement statement)SFBaseSessiongetSFSession()Returns the default SFSession client implementation.SFBaseStatementgetSFStatement()Returns the default SFStatement client implementation.protected voidinitialize(SnowflakeConnectString conStr, String appID, String appVersion)voidinitializeConnection(String url, Properties info)Initializes the SnowflakeConnectionstatic Map<String,Object>mergeProperties(SnowflakeConnectString conStr)Processes parameters given in the connection string.booleansupportsAsyncQuery()-
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 objectskipOpen- 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- Returns:
- a map containing accountName, databaseName and schemaName if specified
-
supportsAsyncQuery
public boolean supportsAsyncQuery()
- Specified by:
supportsAsyncQueryin interfaceSFConnectionHandler- Returns:
- Whether this Connection supports asynchronous queries. If yes, createAsyncResultSet may be called.
-
initializeConnection
public void initializeConnection(String url, Properties info) throws SQLException
Description copied from interface:SFConnectionHandlerInitializes the SnowflakeConnection- Specified by:
initializeConnectionin interfaceSFConnectionHandler- Parameters:
url- url stringinfo- connection parameters- Throws:
SQLException- if any error is encountered
-
getSFSession
public SFBaseSession getSFSession()
Returns the default SFSession client implementation.- Specified by:
getSFSessionin interfaceSFConnectionHandler- Returns:
- Gets the SFBaseSession implementation for this connection implementation
-
getSFStatement
public SFBaseStatement getSFStatement()
Returns the default SFStatement client implementation.- Specified by:
getSFStatementin interfaceSFConnectionHandler- Returns:
- Returns the SFStatementInterface implementation for this connection implementation
-
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:SFConnectionHandlerCreates a result set from a query id.- Specified by:
createResultSetin interfaceSFConnectionHandler- Parameters:
queryID- the query IDstatement- Statement object- Returns:
- ResultSet
- Throws:
SQLException- if any error occurs
-
createResultSet
public SnowflakeBaseResultSet createResultSet(SFBaseResultSet resultSet, Statement statement) throws SQLException
- Specified by:
createResultSetin interfaceSFConnectionHandler- Parameters:
resultSet- SFBaseResultSetstatement- Statement- Returns:
- Creates a SnowflakeResultSet from a base SFBaseResultSet for this connection implementation.
- Throws:
SQLException- if an error occurs
-
createAsyncResultSet
public SnowflakeBaseResultSet createAsyncResultSet(SFBaseResultSet resultSet, Statement statement) throws SQLException
Description copied from interface:SFConnectionHandlerCreates an asynchronous result set from a base SFBaseResultSet for this connection implementation.- Specified by:
createAsyncResultSetin interfaceSFConnectionHandler- Parameters:
resultSet- SFBaseResultSetstatement- Statement- Returns:
- An asynchronous result set from SFBaseResultSet
- Throws:
SQLException- if an error occurs
-
getFileTransferAgent
public SFBaseFileTransferAgent getFileTransferAgent(String command, SFBaseStatement statement) throws SQLNonTransientConnectionException, SnowflakeSQLException
- Specified by:
getFileTransferAgentin interfaceSFConnectionHandler- 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
-
-