Package net.snowflake.client.jdbc
Interface SnowflakeConnection
-
- All Known Implementing Classes:
SnowflakeConnectionV1
public interface SnowflakeConnection
This interface defines Snowflake specific APIs for Connection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResultSet
createResultSet(String queryID)
Create a new instance of a ResultSet object based off query ID.InputStream
downloadStream(String stageName, String sourceFileName, boolean decompress)
Download file from the given stage and return an input streamSFConnectionHandler
getHandler()
Returns the SnowflakeConnectionImpl from the connection object.String
getSessionID()
Return unique session ID from current session generated by making connectionvoid
uploadStream(String stageName, String destPrefix, InputStream inputStream, String destFileName, boolean compressData)
Method to compress data from a stream and upload it at a stage location.
-
-
-
Method Detail
-
uploadStream
void uploadStream(String stageName, String destPrefix, InputStream inputStream, String destFileName, boolean compressData) throws SQLException
Method to compress data from a stream and upload it at a stage location. The data will be uploaded as one file. No splitting is done in this method.caller is responsible for releasing the inputStream after the method is called.
- Parameters:
stageName
- stage name: e.g. ~ or table name or stage namedestPrefix
- path prefix under which the data should be uploaded on the stageinputStream
- input stream from which the data will be uploadeddestFileName
- destination file name to usecompressData
- compress data or not before uploading stream- Throws:
SQLException
- failed to compress and put data from a stream at stage
-
downloadStream
InputStream downloadStream(String stageName, String sourceFileName, boolean decompress) throws SQLException
Download file from the given stage and return an input stream- Parameters:
stageName
- stage namesourceFileName
- file path in stagedecompress
- true if file compressed- Returns:
- an input stream
- Throws:
SnowflakeSQLException
- if any SQL error occurs.SQLException
-
getSessionID
String getSessionID() throws SQLException
Return unique session ID from current session generated by making connection- Returns:
- a unique alphanumeric value representing current session ID
- Throws:
SQLException
-
createResultSet
ResultSet createResultSet(String queryID) throws SQLException
Create a new instance of a ResultSet object based off query ID. ResultSet will contain results of corresponding query. Used when original ResultSet object is no longer available, such as when original connection has been closed.- Parameters:
queryID
-- Returns:
- Throws:
SQLException
-
getHandler
SFConnectionHandler getHandler()
Returns the SnowflakeConnectionImpl from the connection object.
-
-