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
`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 stream
`String` `getSessionID()` Return unique session ID from current session generated by making connection
`void` `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 name
  `destPrefix` - path prefix under which the data should be uploaded on the stage
  `inputStream` - input stream from which the data will be uploaded
  `destFileName` - destination file name to use
  `compressData` - 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 name
  `sourceFileName` - file path in stage
  `decompress` - 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`