# Interface IDatabricksSession

All Known Implementing Classes:
  `DatabricksSession`

public interface IDatabricksSession
Session interface to represent an open connection to Databricks server.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Closes the session.
`void`
`forceClose()`
`String`
`getCatalog()`
Returns default catalog associated with the session
`Map<String,String>`
`getClientInfoProperties()`
Returns the client info properties
`CompressionCodec`
`getCompressionCodec()`
Returns the compression algorithm used on results data
`IDatabricksComputeResource`
`getComputeResource()`
Get the warehouse associated with the session.
`String`
`getConfigValue(String name)`
`IDatabricksConnectionContext`
`getConnectionContext()`
Returns the associated connection context for the session
`String`
`getCurrentCatalog()`
Gets the current catalog from the database
`IDatabricksClient`
`getDatabricksClient()`
Returns the client for connecting to Databricks server
`IDatabricksMetadataClient`
`getDatabricksMetadataClient()`
Returns the metadata client
`String`
`getSchema()`
Returns default schema associated with the session
`Map<String,String>`
`getSessionConfigs()`
Returns the session configs
`String`
`getSessionId()`
Get the unique session-Id associated with the session.
`ImmutableSessionInfo`
`getSessionInfo()`
`boolean`
`isOpen()`
Checks if session is open and valid.
`void`
`open()`
Opens a new session.
`void`
`setCatalog(String catalog)`
Sets the default catalog
`void`
`setClientInfoProperty(String name, String value)`
Sets the client info property
`void`
`setEmptyMetadataClient()`
`void`
`setSchema(String schema)`
Sets the default schema
`void`
`setSessionConfig(String name, String value)`
Sets the session config
`String`
`toString()`
Extracts session to a string

## Method Details

### getSessionId

@Nullable String getSessionId()
Get the unique session-Id associated with the session.

Returns:
  session-Id

### getSessionInfo

@Nullable ImmutableSessionInfo getSessionInfo()

### getComputeResource

IDatabricksComputeResource getComputeResource() throws DatabricksSQLException
Get the warehouse associated with the session.

Returns:
  warehouse-Id
Throws:
  `DatabricksSQLException`

### isOpen

boolean isOpen()
Checks if session is open and valid.

Returns:
  true if session is open

### open

void open() throws DatabricksSQLException
Opens a new session.

Throws:
  `DatabricksSQLException`

### close

void close() throws DatabricksSQLException
Closes the session.

Throws:
  `DatabricksSQLException`

### getDatabricksClient

IDatabricksClient getDatabricksClient()
Returns the client for connecting to Databricks server

### getDatabricksMetadataClient

IDatabricksMetadataClient getDatabricksMetadataClient()
Returns the metadata client

### getCatalog

String getCatalog()
Returns default catalog associated with the session

### getCompressionCodec

CompressionCodec getCompressionCodec()
Returns the compression algorithm used on results data

### getSchema

String getSchema()
Returns default schema associated with the session

### setCatalog

void setCatalog(String catalog)
Sets the default catalog

### setSchema

void setSchema(String schema)
Sets the default schema

### toString

String toString()
Extracts session to a string

Overrides:
  `toString` in class `Object`

### getSessionConfigs

Map<String,String> getSessionConfigs()
Returns the session configs

### setSessionConfig

void setSessionConfig(String name, String value)
Sets the session config

### getClientInfoProperties

Map<String,String> getClientInfoProperties()
Returns the client info properties

### getConfigValue

String getConfigValue(String name)

### setClientInfoProperty

void setClientInfoProperty(String name, String value)
Sets the client info property

### getConnectionContext

IDatabricksConnectionContext getConnectionContext()
Returns the associated connection context for the session

### getCurrentCatalog

String getCurrentCatalog() throws DatabricksSQLException
Gets the current catalog from the database

Throws:
  `DatabricksSQLException`

### setEmptyMetadataClient

void setEmptyMetadataClient()

### forceClose

void forceClose()