Class SQLServerConnection
- java.lang.Object
-
- migratedb.core.internal.database.base.BaseConnection<SQLServerDatabase>
-
- migratedb.core.internal.database.sqlserver.SQLServerConnection
-
- All Implemented Interfaces:
AutoCloseable,Connection<SQLServerDatabase>
- Direct Known Subclasses:
SynapseConnection
public class SQLServerConnection extends BaseConnection<SQLServerDatabase>
SQL Server connection.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringoriginalDatabaseName-
Fields inherited from class migratedb.core.internal.database.base.BaseConnection
database, jdbcTemplate, originalSchemaNameOrSearchPath
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSQLServerConnection(SQLServerDatabase database, Connection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoRestoreOriginalState()protected StringgetCurrentSchemaNameOrSearchPath()SQLServerEngineEditiongetEngineEdition()Schema<?,?>getSchema(String name)Retrieves the schema with this name in the database.BooleanisAzureConnection()<T> Tlock(Table<?,?> table, Callable<T> callable)Locks this table and executes this callable.-
Methods inherited from class migratedb.core.internal.database.base.BaseConnection
changeCurrentSchemaTo, close, doChangeCurrentSchemaOrSearchPathTo, doGetCurrentSchema, getCurrentSchema, getJdbcConnection, getJdbcTemplate, restoreOriginalState
-
-
-
-
Field Detail
-
originalDatabaseName
protected final String originalDatabaseName
-
-
Constructor Detail
-
SQLServerConnection
protected SQLServerConnection(SQLServerDatabase database, Connection connection)
-
-
Method Detail
-
getCurrentSchemaNameOrSearchPath
protected String getCurrentSchemaNameOrSearchPath() throws SQLException
- Specified by:
getCurrentSchemaNameOrSearchPathin classBaseConnection<SQLServerDatabase>- Throws:
SQLException- when the current schema name or search path could not be retrieved.
-
doRestoreOriginalState
protected void doRestoreOriginalState() throws SQLException- Overrides:
doRestoreOriginalStatein classBaseConnection<SQLServerDatabase>- Throws:
SQLException
-
getSchema
public Schema<?,?> getSchema(String name)
Description copied from interface:ConnectionRetrieves the schema with this name in the database.
-
lock
public <T> T lock(Table<?,?> table, Callable<T> callable)
Description copied from interface:ConnectionLocks this table and executes this callable.- Specified by:
lockin interfaceConnection<SQLServerDatabase>- Overrides:
lockin classBaseConnection<SQLServerDatabase>- Returns:
- The result of the callable.
-
isAzureConnection
public Boolean isAzureConnection()
-
getEngineEdition
public SQLServerEngineEdition getEngineEdition()
-
-