Package com.databricks.jdbc.api.internal
Interface IDatabricksSession
-
- All Known Implementing Classes:
DatabricksSession
public interface IDatabricksSessionSession interface to represent an open connection to Databricks server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes the session.voidforceClose()booleangetAutoCommit()Retrieves the current auto-commit mode for this session.StringgetCatalog()Returns default catalog associated with the sessionMap<String,String>getClientInfoProperties()Returns the client info propertiesCompressionCodecgetCompressionCodec()Returns the compression algorithm used on results dataIDatabricksComputeResourcegetComputeResource()Get the warehouse associated with the session.StringgetConfigValue(String name)IDatabricksConnectionContextgetConnectionContext()Returns the associated connection context for the sessionStringgetCurrentCatalog()Gets the current catalog from the databaseIDatabricksClientgetDatabricksClient()Returns the client for connecting to Databricks serverIDatabricksMetadataClientgetDatabricksMetadataClient()Returns the metadata clientStringgetSchema()Returns default schema associated with the sessionMap<String,String>getSessionConfigs()Returns the session configsStringgetSessionId()Get the unique session-Id associated with the session.ImmutableSessionInfogetSessionInfo()booleanisOpen()Checks if session is open and valid.voidopen()Opens a new session.voidsetAutoCommit(boolean autoCommit)Sets the auto-commit mode for this session.voidsetCatalog(String catalog)Sets the default catalogvoidsetClientInfoProperty(String name, String value)Sets the client info propertyvoidsetEmptyMetadataClient()voidsetSchema(String schema)Sets the default schemavoidsetSessionConfig(String name, String value)Sets the session configStringtoString()Extracts session to a string
-
-
-
Method Detail
-
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 SQLException
Opens a new session.- Throws:
SQLException
-
close
void close() throws SQLExceptionCloses the session.- Throws:
SQLException
-
getDatabricksClient
IDatabricksClient getDatabricksClient()
Returns the client for connecting to Databricks server- Returns:
- the Databricks client
-
getDatabricksMetadataClient
IDatabricksMetadataClient getDatabricksMetadataClient()
Returns the metadata client- Returns:
- the Databricks metadata client
-
getCatalog
String getCatalog()
Returns default catalog associated with the session- Returns:
- the default catalog
-
getCompressionCodec
CompressionCodec getCompressionCodec()
Returns the compression algorithm used on results data- Returns:
- the compression codec
-
getSchema
String getSchema()
Returns default schema associated with the session- Returns:
- the default schema
-
setCatalog
void setCatalog(String catalog)
Sets the default catalog- Parameters:
catalog- the catalog to set
-
setSchema
void setSchema(String schema)
Sets the default schema- Parameters:
schema- the schema to set
-
getSessionConfigs
Map<String,String> getSessionConfigs()
Returns the session configs- Returns:
- map of session configuration key-value pairs
-
setSessionConfig
void setSessionConfig(String name, String value)
Sets the session config- Parameters:
name- the configuration namevalue- the configuration value
-
getClientInfoProperties
Map<String,String> getClientInfoProperties()
Returns the client info properties
-
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()
-
setAutoCommit
void setAutoCommit(boolean autoCommit)
Sets the auto-commit mode for this session.- Parameters:
autoCommit- true to enable auto-commit; false to disable
-
getAutoCommit
boolean getAutoCommit()
Retrieves the current auto-commit mode for this session.- Returns:
- true if auto-commit mode is enabled; false otherwise
-
-