public class MsSqlDriver extends CallableDriver
| Modifier and Type | Field and Description |
|---|---|
static String |
BEGIN
The BEGIN sql.
|
static String |
BEGIN_SPLITED
The BEGIN_SPLITED sql.
|
static String |
DECLARE
The DECLARE sql.
|
static String |
END
The END sql.
|
static String |
END_SPLITED
The END_SPLITED sql.
|
static String |
EXCEPTIONS
The EXCEPTIONS sql.
|
static String |
IF
The IF sql.
|
static String |
IF_BEGIN
The IF_BEGIN sql.
|
static String |
IF_ELSE
The IF_ELSE sql.
|
static String |
IF_END
The IF_END sql.
|
static String |
INIT_SQL
The INIT sql.
|
static int |
LINES_LIMIT
The maximum number of lines allowed in the sql block.
|
static int |
MAX_CHAR_SIZE
The maximum char size.
|
static int |
MAX_NUMBER_PREC_SIZE
The maximum precision.
|
static int |
MAX_NUMBER_SCALE_SIZE
The maximum scale.
|
static int |
MAX_STRING_LITERAL_SIZE
The maximum string literal size.
|
static int |
MAX_VARCHAR_SIZE
The maximum varchar size.
|
static String |
MSSQL_HOME_PROP
The MSSQL client HOME property.
|
static String |
MSSQL_HOME_VAR
The MSSQL client HOME variable.
|
static String |
ON_EXCEPTION
The ON_EXCEPTION sql.
|
static String |
ON_EXCEPTION_BEGIN
The ON_EXCEPTION_BEGIN sql.
|
static String |
ON_EXCEPTION_END
The ON_EXCEPTION_END sql.
|
ALLOWED_IDENT_CHARSBASE_CLASS_PATH, CASE_SENSITIVE_LOWER, CASE_SENSITIVE_LOWER_STR, CASE_SENSITIVE_UNDEFINED, CASE_SENSITIVE_UPPER, CASE_SENSITIVE_UPPER_STR, CMD_OPTIONS_PARAM, DB_PARAM, DDL_TYPE, ETL_CODE, FUNC_TYPE, PROC_TYPE, SERVER_PARAM, TABLE_TYPEAPP, COMMAND, ETL_DRIVER, FORMATTER, IDE_NODE, NO_RANK, WIDGET| Constructor and Description |
|---|
MsSqlDriver() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
_getInitSql()
Gets init sql.
|
protected int |
_getLinesLimit()
Gets lines limit.
|
protected int |
_getMaxCharSize()
Gets max char size.
|
protected int |
_getMaxPrecision()
Gets max precision.
|
protected int |
_getMaxScale()
Gets the max scale.
|
protected int |
_getMaxStringLiteralSize()
Gets the max string literal size.
|
protected int |
_getMaxVarcharSize()
Gets the max varchar size.
|
String |
convertStringForStorage(String value)
Converts string so it can be used as s part of sql.
|
String |
convertValueForStorage(Object fieldValue,
int fieldType,
boolean isFromTable)
Converts value to string depending on
fieldType so it can be
used as s part of sql. |
String |
getAddColumnSql()
Gets the ADD COLUMN SQL.
|
Object |
getAutotrace(ObjectStorage storage,
Connection connection,
Alias alias,
String sql)
Executes sql and produces real execution plan.
|
String |
getBegin()
Gets the "begin" sql statement.
|
String |
getBeginSplited()
Gets the "begin" token for splited sql.
|
String |
getCallSql(String name)
Gets the "call" sql.
|
String |
getCmdForExternalTool(ObjectStorage storage,
Alias alias,
String sqlFile)
Gets the command line for the external tool.
|
String |
getCreateTableSql(String name,
DataSet dataSet,
boolean isTemporary,
String key,
FieldsRepository fieldsRepository)
Gets the "create table" sql.
|
String |
getCursorLoopEndSql(String name,
DataSet dataSet)
Gets the "loop end" sql for the cursor.
|
String |
getCursorLoopStartSql(String name,
String cursorSql,
DataSet dataSet)
Gets the "loop start" sql for the cursor.
|
String |
getCursorRecAccessSql(String fieldName)
Gets the record access sql for the cursor.
|
String |
getCursorVarName(String field)
Gets the cursor variable name.
|
protected String |
getDateTimeStyle()
Gets the date+time style.
|
static String |
getDbName(Alias alias)
Gets the database name.
|
String |
getDeclare()
Gets the "declare" sql.
|
String |
getDeclareCursorEndSql()
Gets the "declare cursor end" sql.
|
String |
getDeclareCursorSql(String sql,
String name,
String cursorSql,
DataSet dataSet)
Gets the "declare cursor" sql.
|
String |
getDeclareCursorVarSql(String sql,
DataSet dataSet,
String key,
FieldsRepository fieldsRepository,
Set<String> variables)
Gets the "declare cursor variable" sql.
|
String |
getDefaultFunctionClass()
Gets the default function class name.
|
String |
getDefaultType()
Gets the default database type.
|
String |
getDropSql(String type,
String name)
Gets the "drop" sql.
|
String |
getEnd()
Gets the "end" sql.
|
String |
getEndSplited()
Gets the "end" token for the splited sql statement.
|
Object |
getExplainPlan(ObjectStorage storage,
Connection connection,
Alias alias,
String sql)
Gets the explain plan for the sql.
|
String |
getExternalToolName()
Gets the external tool name.
|
String |
getFetchNextSql(String name,
DataSet dataSet)
Gets the "fetch next" sql.
|
String |
getHome(ObjectStorage storage)
Gets the home folder for the native database client.
|
String |
getIconPath()
Gets the full path to the icon file.
|
String |
getIf()
Gets the "if" token.
|
String |
getIfBegin()
Gets the "if begin" token.
|
String |
getIfElse()
Gets the "if else" token.
|
String |
getIfEnd()
Gets the "if end" token.
|
String |
getJdbcDriverClassName()
Gets the jdbc driver class name.
|
String |
getLicensePropertyName()
Gets the name of the license property.
|
String |
getMergeStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues,
String tableName,
String key)
Gets the merge statement.
|
String |
getMetadataClassName()
Gets the metadata driver class name.
|
String |
getMetadataSelectClause()
Gets the metadata "select" clause.
|
String |
getMetadataWhereClause()
Gets the metadata "where" clause.
|
String |
getName()
Gets the name of the driver.
|
Object |
getObject(ResultSet rs,
int index,
FieldDef fieldDef)
Gets the object from result set.
|
String |
getOnException(OnException onException)
Gets the "on exception" sql.
|
String |
getOnExceptionBegin(OnException onException,
long row)
Gets the "on exception begin" sql.
|
String |
getOnExceptionEnd()
Gets the "on exception end" sql.
|
int |
getParamType(String type)
Gets the parameter type from the output variable type.
|
String[] |
getProperties()
Gets the properties.
|
String |
getPropsWizardResource(String connectionDriver)
Gets the name of the xml file used to create a wizard for editing
properties.
|
String |
getSafeDelimiter()
Gets the safe delimiter which can be added to any sql statetement.
|
String |
getSafeSql(String sql)
Gets the safe sql.
|
static String |
getServer(Alias alias,
String subst)
Gets the server name.
|
String |
getSqlForExternalTool(Alias alias,
String sql,
SqlParser parser)
Gets the sql for external tool.
|
String |
getSqlKeywordsFileName()
Gets the sql keywords file name.
|
String |
getTempTableName(String name)
Gets the temporary table name.
|
String |
getTopSelectClause(int top)
Gets the "top select" clause.
|
String |
getTopTrailClause(int top)
Gets the "top trail" clause.
|
String |
getTopWhereClause(int top)
Gets the "top where" clause.
|
String |
getType(FieldDef fieldDef,
String key,
FieldsRepository fieldsRepository)
Gets the native field type.
|
String |
getUrlPattern()
Gets the jdbc driver url pattern.
|
String |
getVarDeclare()
Gets the variable declare statement.
|
String |
getVarName(String name)
Gets the variable name.
|
String |
getVendor()
Gets the vendor.
|
String |
getVersion()
Gets the version of the extension module.
|
String |
getXmlConfigFileName()
Gets the path to the xml configuration file for the module.
|
boolean |
ignoreExceptionsDuringInit()
The "Ignore exceptions during initialization" flag.
|
boolean |
isMergeInNonCallableSupported()
Checks if "merge" statement can be not callable.
|
String[] |
supportedJoinTypes()
Returns supported join types, such as inner join, left outer join etc.
|
String[] |
supportedSetOperations()
Returns names of the supported set operations, such as union, union all,
etc.
|
boolean |
supportsAnonymousBlocks()
"Supports anonymous blocks" flag.
|
String |
supportsAutotrace()
Checks if driver supports autotrace.
|
boolean |
supportsBinaryInProc()
"Supports binary data types in procedures" flag.
|
boolean |
supportsCallableStatement()
"Supports callable statement" flag.
|
boolean |
supportsExplainPlan()
"Supports explain plan" flag.
|
boolean |
supportsExternalTool()
"Supports external tool" flag.
|
boolean |
supportsInnerFunctions()
"Supports inner functions" flag.
|
boolean |
supportsParamsInAnonymousBlocks()
"Supports parameters in anonymous blocks" flag.
|
boolean |
supportsRollbackAfterDDL()
"Supports rollback after ddl" flag.
|
deleteStagingBinary, getBlob, getCharUsedForColumnsWithSpaces, getClob, getDestinationInfo, getInitSql, getLinesLimit, getMaxCharSize, getMaxPrecision, getMaxScale, getMaxStringLiteralSize, getMaxVarcharSize, getParentDriverName, getWrongScale, replaceOnException, setBlob, setClob, setInitSql, setLinesLimit, setMaxCharSize, setMaxPrecision, setMaxScale, setMaxStringLiteralSize, setMaxVarcharSize, setParentDriverName, supportsIndexes, supportsScripts, updateStagingBlob, updateStagingClob, value2StorageValuealwaysEncloseTableAndColumnsInQuotes, captureLog, compareTo, externalToolRequiresRedirect, filter, getAllowedIdentifierChars, getAlterTableAddColumnSql, getAlterTableAddColumnSql, getCaseSensitive, getCmdOptions, getColumns, getConfigFileName, getConnectionFile, getDefaultNull, getDeleteStatement, getDelimiter, getDisplayName, getErrorLinePattern, getExtensionRank, getIdentifierName, getIdentifierName, getInsertStatement, getLocalUnitClassPath, getNativeType, getObjectCheckSql, getParentDriver, getPostDeclareSql, getSelectStatement, getSqlForAutotrace, getSqlForExplainPlan, getStartTransactionSql, getStringFieldSizeMultiplier, getTableName, getTablePrefixWhenAddingTable, getType, getUpdateStatement, isEqualDriver, needSeparateConnectionForDdl, requiresExecuteQuery, requiresRollbackAfterSqlError, requiresSeparateConnectionForIndexes, setAlwaysEncloseTableAndColumnsInQuotes, setCaseSensitive, setStringFieldSizeMultiplier, setUpConnection, supportColonInFormatter, supportsLogging, supportsNotNullable, supportsParallelExtract, supportsParallelLoad, supportsParentDriver, supportsPreparedStatement, supportsPreparedStatementInParallelThreads, supportsPreparedStatementInTransaction, tableName2Name, typeHasSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisableMetadataOnWrite, getIoProcessorClassName, getPrecision, ifDoesNotExistSql, ifExistsSql, openCloseConnectionOnDdl, requiresSemicolonInMergepublic static final String MSSQL_HOME_VAR
public static final String MSSQL_HOME_PROP
public static int MAX_STRING_LITERAL_SIZE
public static int MAX_VARCHAR_SIZE
public static int LINES_LIMIT
public static int MAX_CHAR_SIZE
public static int MAX_NUMBER_PREC_SIZE
public static int MAX_NUMBER_SCALE_SIZE
public static final String INIT_SQL
public static final String DECLARE
public static final String BEGIN
public static final String BEGIN_SPLITED
public static final String END
public static final String END_SPLITED
public static final String IF
public static final String IF_BEGIN
public static final String IF_ELSE
public static final String IF_END
public static final String EXCEPTIONS
public static final String ON_EXCEPTION_BEGIN
public static final String ON_EXCEPTION
public static final String ON_EXCEPTION_END
public static String getDbName(Alias alias)
alias - the aliaspublic static String getServer(Alias alias, String subst)
alias - the aliassubst - the substringprotected String _getInitSql()
CallableDriver_getInitSql in class CallableDriverprotected int _getLinesLimit()
CallableDriver_getLinesLimit in class CallableDriverprotected int _getMaxCharSize()
CallableDriver_getMaxCharSize in class CallableDriverprotected int _getMaxPrecision()
CallableDriver_getMaxPrecision in class CallableDriverprotected int _getMaxScale()
CallableDriver_getMaxScale in class CallableDriverprotected int _getMaxStringLiteralSize()
CallableDriver_getMaxStringLiteralSize in class CallableDriverprotected int _getMaxVarcharSize()
CallableDriver_getMaxVarcharSize in class CallableDriverpublic String convertStringForStorage(String value)
Drivervalue - the valuepublic String convertValueForStorage(Object fieldValue,
int fieldType,
boolean isFromTable)
DriverfieldType so it can be
used as s part of sql.fieldValue - the field valuefieldType - the field type Types}isFromTable - if true the value is coming from result set, otherwise - from
the database cursorpublic Object getAutotrace(ObjectStorage storage, Connection connection, Alias alias, String sql)
DrivergetAutotrace in interface DrivergetAutotrace in class AbstractDriverstorage - the object storageconnection - the connectionalias - the aliassql - the sqlObjectStoragepublic String getBegin()
Driverpublic String getBeginSplited()
Driverpublic String getCallSql(String name)
Drivername - the name of the procedurepublic String getCmdForExternalTool(ObjectStorage storage, Alias alias, String sqlFile)
Driverstorage - the object storagealias - the aliassqlFile - the sql fileObjectStoragepublic String getCreateTableSql(String name,
DataSet dataSet,
boolean isTemporary,
String key,
FieldsRepository fieldsRepository)
Drivername - the table namedataSet - the data setisTemporary - if true the table is temporarykey - the key field(s)fieldsRepository - the fields repositoryFieldsRepositorypublic String getCursorLoopEndSql(String name,
DataSet dataSet)
Drivername - the name of the cusrordataSet - the data setpublic String getSafeDelimiter()
DrivergetSafeDelimiter in interface DrivergetSafeDelimiter in class AbstractDriverpublic String getCursorLoopStartSql(String name,
String cursorSql,
DataSet dataSet)
Drivername - the name of the cursorcursorSql - the cursor sqldataSet - the data setpublic String getCursorRecAccessSql(String fieldName)
DriverfieldName - the field namepublic String getCursorVarName(String field)
field - the fieldprotected String getDateTimeStyle()
public String getDeclare()
Driverpublic String getDeclareCursorEndSql()
Driverpublic String getDeclareCursorSql(String sql,
String name,
String cursorSql,
DataSet dataSet)
Driversql - the sqlname - the name of the cursorcursorSql - the cursor sqldataSet - the data setpublic String getDeclareCursorVarSql(String sql,
DataSet dataSet,
String key,
FieldsRepository fieldsRepository,
Set<String> variables)
Driversql - the sqldataSet - the data setkey - the key field(s)fieldsRepository - the fields repositoryvariables - the variablesFieldsRepositorypublic String getDefaultFunctionClass()
DriverFunctionpublic String getDefaultType()
Driverpublic String getDropSql(String type,
String name)
Drivertype - the object type. Possible values: PROC_TYPE, FUNC_TYPE,
DDL_TYPE, TABLE_TYPEname - the object namepublic String getEnd()
Driverpublic String getEndSplited()
Driverpublic Object getExplainPlan(ObjectStorage storage, Connection connection, Alias alias, String sql)
Driverstorage - the object storageconnection - the connectionalias - the aliassql - the sqlObjectStoragepublic String getExternalToolName()
Driverpublic String getFetchNextSql(String name,
DataSet dataSet)
name - the cursor namedataSet - the data setpublic String getHome(ObjectStorage storage)
DrivergetHome in interface DrivergetHome in class AbstractDriverstorage - the object storageObjectStoragepublic String getIconPath()
ExtensionModulepublic String getIf()
Driverpublic String getIfBegin()
Driverpublic String getIfElse()
Driverpublic String getIfEnd()
Driverpublic String getJdbcDriverClassName()
Driverpublic String getLicensePropertyName()
ExtensionModulegetLicensePropertyName in interface ExtensionModulegetLicensePropertyName in class AbstractDriverpublic String getMetadataClassName()
Driverpublic String getMetadataSelectClause()
Driverpublic String getMetadataWhereClause()
Driverpublic String getName()
Driverpublic Object getObject(ResultSet rs,
int index,
FieldDef fieldDef)
throws Exception
DrivergetObject in interface DrivergetObject in class CallableDriverrs - the result setindex - the index of the fieldfieldDef - the field typeException - in case of any errorpublic String getOnException(OnException onException)
DriveronException - the OnExceptionOnExceptionpublic String getOnExceptionBegin(OnException onException, long row)
DriveronException - the OnExceptionrow - the rowOnExceptionpublic String getOnExceptionEnd()
Driverpublic int getParamType(String type)
Drivertype - the output variable typepublic String[] getProperties()
DrivergetProperties in interface DrivergetProperties in class AbstractDriverpublic String getPropsWizardResource(String connectionDriver)
DriverconnectionDriver - the connection driverpublic String getSafeSql(String sql)
DriverFor example table abc does not exist delete from abc -- not safe EXECUTE IMMEDIATE 'delete from abc' -- safe
getSafeSql in interface DrivergetSafeSql in class AbstractDriversql - the namepublic String getSqlForExternalTool(Alias alias, String sql, SqlParser parser)
Driveralias - the aliassql - the original sqlparser - the sql parserpublic String getSqlKeywordsFileName()
DrivergetSqlKeywordsFileName in interface DrivergetSqlKeywordsFileName in class AbstractDriverpublic String getTempTableName(String name)
Drivername - the namepublic String getTopSelectClause(int top)
Drivertop - the maximum number of rows to selectpublic String getTopTrailClause(int top)
Drivertop - the maximum number of rows to selectpublic String getTopWhereClause(int top)
Drivertop - the maximum number of rows to selectpublic String getType(FieldDef fieldDef, String key, FieldsRepository fieldsRepository)
DriverfieldDef - the field definitionkey - the key field(s)fieldsRepository - the fields repositorypublic String getUrlPattern()
Driverpublic String getVarDeclare()
Driverpublic String getVarName(String name)
DrivergetVarName in interface DrivergetVarName in class CallableDrivername - the namepublic String getVendor()
ExtensionModulepublic String getVersion()
ExtensionModulepublic String getXmlConfigFileName()
ExtensionModulepublic boolean ignoreExceptionsDuringInit()
Driverpublic boolean isMergeInNonCallableSupported()
DriverisMergeInNonCallableSupported in interface DriverisMergeInNonCallableSupported in class AbstractDriverpublic String getMergeStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName, String key)
DrivergetMergeStatement in interface DrivergetMergeStatement in class AbstractDriverfieldsAndValues - the fields and valuestableName - the table namekey - the key field(s)public String[] supportedJoinTypes()
Driverpublic String[] supportedSetOperations()
Driverpublic boolean supportsAnonymousBlocks()
Driverpublic String supportsAutotrace()
DriversupportsAutotrace in interface DriversupportsAutotrace in class AbstractDriverpublic boolean supportsBinaryInProc()
Driverpublic boolean supportsCallableStatement()
Driverpublic boolean supportsExplainPlan()
Driverpublic boolean supportsExternalTool()
Driverpublic boolean supportsInnerFunctions()
Driverpublic boolean supportsParamsInAnonymousBlocks()
Driverpublic boolean supportsRollbackAfterDDL()
Driverpublic String getAddColumnSql()
DrivergetAddColumnSql in interface DrivergetAddColumnSql in class AbstractDriverCopyright © 2010-2020 Toolsverse. All Rights Reserved.