Package org.apache.hop.databases.mssql
Class MsSqlServerDatabaseMeta
java.lang.Object
org.apache.hop.core.database.BaseDatabaseMeta
org.apache.hop.databases.mssql.MsSqlServerDatabaseMeta
@DatabaseMetaPlugin(type="MSSQL",
typeDescription="MS SQL Server",
documentationUrl="/database/databases/mssql.html")
@GuiPlugin(id="GUI-MSSQLServerDatabaseMeta")
public class MsSqlServerDatabaseMeta
extends BaseDatabaseMeta
implements IDatabase
Contains MS SQL specific information through static final members
-
Field Summary
FieldsFields inherited from class org.apache.hop.core.database.BaseDatabaseMeta
accessType, ATTRIBUTE_FORCE_IDENTIFIERS_TO_LOWERCASE, ATTRIBUTE_FORCE_IDENTIFIERS_TO_UPPERCASE, ATTRIBUTE_MSSQL_DOUBLE_DECIMAL_SEPARATOR, ATTRIBUTE_PREFERRED_SCHEMA_NAME, ATTRIBUTE_PREFIX_EXTRA_OPTION, ATTRIBUTE_PRESERVE_RESERVED_WORD_CASE, ATTRIBUTE_QUOTE_ALL_FIELDS, ATTRIBUTE_SQL_CONNECT, ATTRIBUTE_SUPPORTS_BOOLEAN_DATA_TYPE, ATTRIBUTE_SUPPORTS_TIMESTAMP_DATA_TYPE, ATTRIBUTE_USE_RESULT_STREAMING, attributes, AUTOINCREMENT_SQL_FOR_BATCH_ID, databaseName, dataTablespace, hostname, ID_PASSWORD_LABEL, ID_PASSWORD_WIDGET, ID_USERNAME_LABEL, ID_USERNAME_WIDGET, indexTablespace, manualUrl, password, pluginId, pluginName, port, releaseSavepoint, SELECT_COUNT_STATEMENT, SEQUENCE_FOR_BATCH_ID, servername, username -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]getAddColumnStatement(String tableName, IValueMeta v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to add a column to the specified tableintgetDropColumnStatement(String tableName, IValueMeta v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to drop a column from the specified tablegetFieldDefinition(IValueMeta v, String tk, String pk, boolean useAutoinc, boolean addFieldName, boolean addCr) intgetModifyColumnStatement(String tableName, IValueMeta v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to modify a column in the specified tableString[]getSchemaTableCombination(String schemaName, String tablePart) getSqlColumnExists(String columnname, String tableName) getSqlCurrentSequenceValue(String sequenceName) getSqlInsertAutoIncUnknownDimensionRow(String schemaTable, String keyField, String versionField) Get the SQL to insert a new empty unknown record in a dimension.getSqlLockTables(String[] tableNames) getSqlNextSequenceValue(String sequenceName) getSqlQueryColumnFields(String columnname, String tableName) getSqlQueryFields(String tableName) getSqlSequenceExists(String sequenceName) getSqlTableExists(String tableName) The URL format for jTDS is:booleanVerifies on the specified database connection if an index exists on the fields with the specified name.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanGets usingDoubleDigitquoteSqlString(String string) voidsetInstanceName(String instanceName) voidsetUsingDoubleDigit(boolean usingDoubleDigit) Methods inherited from class org.apache.hop.core.database.BaseDatabaseMeta
addAttribute, addDefaultOptions, addExtraOption, canTest, clone, customizeValueFromSqlType, generateColumnAlias, getAccessType, getAttribute, getAttributeProperty, getAttributeProperty, getAttributes, getConnectSql, getCreateTableStatement, getDatabaseFactoryName, getDatabaseName, getDataTablespace, getDataTablespaceDDL, getDefaultOptions, getDropTableIfExistsStatement, getExtraOptionIndicator, getExtraOptions, getExtraOptionSeparator, getExtraOptionValueSeparator, getFieldnameProtector, getFunctionAverage, getFunctionCount, getFunctionMaximum, getFunctionMinimum, getFunctionSum, getHostname, getIndexTablespace, getIndexTablespaceDDL, getLimitClause, getManualUrl, getMaxColumnsInIndex, getMaxTextFieldLength, getNotFoundTK, getPassword, getPluginId, getPluginName, getPort, getPreferredSchemaName, getSafeFieldname, getSelectCountStatement, getSequenceNoMaxValueOption, getServername, getSqlDeleteStmt, getSqlInsertClauseBeforeFields, getSqlScriptStatements, getSqlUnlockTables, getSqlUpdateStmt, getSqlValue, getSynonymTypes, getTablespaceDDL, getTableTypes, getTruncateTableStatement, getUsername, getValueFromResultSet, getViewTypes, isChanged, isDefaultingToUppercase, isDisplaySizeTwiceThePrecision, isDuckDbVariant, isExasolVariant, isExplorable, isFetchSizeSupported, isForcingIdentifiersToLowerCase, isForcingIdentifiersToUpperCase, isFullExceptionLog, isInformixVariant, isMsSqlServerNativeVariant, isMySqlVariant, isNeedsPlaceHolder, isNeoviewVariant, isNetezzaVariant, isOracleVariant, isPostgresVariant, isPreserveReservedCase, isQuoteAllFields, isQuoteReservedWords, isReleaseSavepoint, isRequiresCastToVariousForIsNull, isRequiresCreateTablePrimaryKeyAppend, isRequiresName, isRequiringTransactionsOnQueries, isSqliteVariant, isStreamingResults, isStrictBigNumberInterpretation, isSupportsAutoGeneratedKeys, isSupportsAutoInc, isSupportsBatchUpdates, isSupportsBooleanDataType, isSupportsCustomDeleteStmt, isSupportsCustomUpdateStmt, isSupportsEmptyTransactions, isSupportsErrorHandling, isSupportsFloatRoundingOnUpdate, isSupportsGetBlob, isSupportsNewLinesInSql, isSupportsOptionsInURL, isSupportsPreparedStatementMetadataRetrieval, isSupportsResultSetMetadataRetrievalOnly, isSupportsSetCharacterStream, isSupportsSetLong, isSupportsSetMaxRows, isSupportsTimestampDataType, isSupportsTimeStampToDateConversion, isSupportsTransactions, isSupportsViews, isSybaseIQVariant, isSybaseVariant, isSystemTable, isTeradataVariant, isUsingDoubleDecimalAsSchemaTableSeparator, onlySpaces, parseStatements, setAccessType, setAttributes, setChanged, setConnectSql, setDatabaseName, setDataTablespace, setForcingIdentifiersToLowerCase, setForcingIdentifiersToUpperCase, setHostname, setIndexTablespace, setManualUrl, setPassword, setPluginId, setPluginName, setPort, setPreferredSchemaName, setPreserveReservedCase, setQuoteAllFields, setServername, setStreamingResults, setSupportsBooleanDataType, setSupportsTimestampDataType, setUsername, setUsingDoubleDecimalAsSchemaTableSeparator, useSchemaNameForTableListMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hop.core.database.IDatabase
addAttribute, addDefaultOptions, addExtraOption, clone, createSqlScriptParser, customizeValueFromSqlType, generateColumnAlias, getAccessType, getAttribute, getAttributes, getConnectSql, getCreateTableStatement, getDatabaseFactoryName, getDatabaseName, getDataTablespace, getDataTablespaceDDL, getDefaultOptions, getDropTableIfExistsStatement, getExtraOptionIndicator, getExtraOptions, getExtraOptionSeparator, getExtraOptionValueSeparator, getFunctionAverage, getFunctionCount, getFunctionMaximum, getFunctionMinimum, getFunctionSum, getHostname, getIndexTablespace, getIndexTablespaceDDL, getLegacyColumnName, getLimitClause, getManualUrl, getMaxColumnsInIndex, getMaxTextFieldLength, getNotFoundTK, getPassword, getPluginId, getPluginName, getPort, getPreferredSchemaName, getSafeFieldname, getSelectCountStatement, getSequenceNoMaxValueOption, getServername, getSqlDeleteStmt, getSqlInsertClauseBeforeFields, getSqlScriptStatements, getSqlUnlockTables, getSqlUpdateStmt, getSqlValue, getSynonymTypes, getTableTypes, getTruncateTableStatement, getUnsupportedTableOutputMessage, getUsername, getValueFromResultSet, getViewTypes, isChanged, isDefaultingToUppercase, isDisplaySizeTwiceThePrecision, isDuckDbVariant, isExasolVariant, isExplorable, isFetchSizeSupported, isForcingIdentifiersToLowerCase, isForcingIdentifiersToUpperCase, isFullExceptionLog, isInformixVariant, isMsSqlServerNativeVariant, isMySqlVariant, isNeedsPlaceHolder, isNeoviewVariant, isNetezzaVariant, isOracleVariant, isPostgresVariant, isPreserveReservedCase, isQuoteAllFields, isQuoteReservedWords, isReleaseSavepoint, isRequiresCastToVariousForIsNull, isRequiresCreateTablePrimaryKeyAppend, isRequiresName, isRequiringTransactionsOnQueries, isSqliteVariant, isStreamingResults, isStrictBigNumberInterpretation, isSupportsAutoGeneratedKeys, isSupportsAutoInc, isSupportsBatchUpdates, isSupportsBooleanDataType, isSupportsCustomDeleteStmt, isSupportsCustomUpdateStmt, isSupportsEmptyTransactions, isSupportsErrorHandling, isSupportsFloatRoundingOnUpdate, isSupportsGetBlob, isSupportsNewLinesInSql, isSupportsOptionsInURL, isSupportsPreparedStatementMetadataRetrieval, isSupportsResultSetMetadataRetrievalOnly, isSupportsSetCharacterStream, isSupportsSetLong, isSupportsSetMaxRows, isSupportsTimestampDataType, isSupportsTimeStampToDateConversion, isSupportsTransactions, isSupportsViews, isSybaseIQVariant, isSybaseVariant, isSystemTable, isTeradataVariant, isUsingDoubleDecimalAsSchemaTableSeparator, parseStatements, setAccessType, setAttributes, setChanged, setConnectSql, setDatabaseName, setDataTablespace, setForcingIdentifiersToLowerCase, setForcingIdentifiersToUpperCase, setHostname, setIndexTablespace, setManualUrl, setPassword, setPluginId, setPluginName, setPort, setPreferredSchemaName, setPreserveReservedCase, setQuoteAllFields, setServername, setStreamingResults, setSupportsBooleanDataType, setSupportsTimestampDataType, setUsername, setUsingDoubleDecimalAsSchemaTableSeparator, supportsStandardTableOutput, useSchemaNameForTableList
-
Field Details
-
CONST_ALTER_TABLE
- See Also:
-
-
Constructor Details
-
MsSqlServerDatabaseMeta
public MsSqlServerDatabaseMeta()
-
-
Method Details
-
getInstanceName
-
setInstanceName
-
isUsingDoubleDigit
public boolean isUsingDoubleDigit()Gets usingDoubleDigit- Returns:
- value of usingDoubleDigit
-
setUsingDoubleDigit
public void setUsingDoubleDigit(boolean usingDoubleDigit) - Parameters:
usingDoubleDigit- The usingDoubleDigit to set
-
isSupportsCatalogs
public boolean isSupportsCatalogs()- Specified by:
isSupportsCatalogsin interfaceIDatabase- Overrides:
isSupportsCatalogsin classBaseDatabaseMeta
-
getAccessTypeList
public int[] getAccessTypeList()- Specified by:
getAccessTypeListin interfaceIDatabase- Specified by:
getAccessTypeListin classBaseDatabaseMeta
-
getDefaultDatabasePort
public int getDefaultDatabasePort()- Specified by:
getDefaultDatabasePortin interfaceIDatabase- Overrides:
getDefaultDatabasePortin classBaseDatabaseMeta
-
getDriverClass
- Specified by:
getDriverClassin interfaceIDatabase
-
getURL
The URL format for jTDS is:jdbc:jtds:<server_type>://<server>[:<port>][/<database>][;<property>=<value>[;...]]
-
getSchemaTableCombination
- Specified by:
getSchemaTableCombinationin interfaceIDatabase- Overrides:
getSchemaTableCombinationin classBaseDatabaseMeta
-
isSupportsBitmapIndex
public boolean isSupportsBitmapIndex()- Specified by:
isSupportsBitmapIndexin interfaceIDatabase- Overrides:
isSupportsBitmapIndexin classBaseDatabaseMeta- Returns:
- true if the database supports bitmap indexes
-
isSupportsSynonyms
public boolean isSupportsSynonyms()- Specified by:
isSupportsSynonymsin interfaceIDatabase- Overrides:
isSupportsSynonymsin classBaseDatabaseMeta- Returns:
- true if the database supports synonyms
-
getSqlQueryFields
- Specified by:
getSqlQueryFieldsin interfaceIDatabase- Overrides:
getSqlQueryFieldsin classBaseDatabaseMeta
-
getSqlTableExists
- Specified by:
getSqlTableExistsin interfaceIDatabase- Overrides:
getSqlTableExistsin classBaseDatabaseMeta
-
getSqlColumnExists
- Specified by:
getSqlColumnExistsin interfaceIDatabase- Overrides:
getSqlColumnExistsin classBaseDatabaseMeta
-
getSqlQueryColumnFields
-
getSqlLockTables
- Specified by:
getSqlLockTablesin interfaceIDatabase- Overrides:
getSqlLockTablesin classBaseDatabaseMeta- Parameters:
tableNames- The names of the tables to lock- Returns:
- The SQL command to lock database tables for write purposes. null is returned in case locking is not supported on the target database. null is the default value
-
getAddColumnStatement
public String getAddColumnStatement(String tableName, IValueMeta v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to add a column to the specified table- Specified by:
getAddColumnStatementin interfaceIDatabase- Parameters:
tableName- The table to addv- The column defined as a valuetk- the name of the technical key fielduseAutoinc- whether or not this field uses auto incrementpk- the name of the primary key fieldsemicolon- whether or not to add a semi-colon behind the statement.- Returns:
- the SQL statement to add a column to the specified table
-
getModifyColumnStatement
public String getModifyColumnStatement(String tableName, IValueMeta v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to modify a column in the specified table- Specified by:
getModifyColumnStatementin interfaceIDatabase- Parameters:
tableName- The table to addv- The column defined as a valuetk- the name of the technical key fielduseAutoinc- whether or not this field uses auto incrementpk- the name of the primary key fieldsemicolon- whether or not to add a semi-colon behind the statement.- Returns:
- the SQL statement to modify a column in the specified table
-
getDropColumnStatement
public String getDropColumnStatement(String tableName, IValueMeta v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to drop a column from the specified table- Specified by:
getDropColumnStatementin interfaceIDatabase- Overrides:
getDropColumnStatementin classBaseDatabaseMeta- Parameters:
tableName- The table to addv- The column defined as a valuetk- the name of the technical key fielduseAutoinc- whether or not this field uses auto incrementpk- the name of the primary key fieldsemicolon- whether or not to add a semi-colon behind the statement.- Returns:
- the SQL statement to drop a column from the specified table
-
getFieldDefinition
public String getFieldDefinition(IValueMeta v, String tk, String pk, boolean useAutoinc, boolean addFieldName, boolean addCr) - Specified by:
getFieldDefinitionin interfaceIDatabase
-
getSqlListOfProcedures
- Specified by:
getSqlListOfProceduresin interfaceIDatabase- Overrides:
getSqlListOfProceduresin classBaseDatabaseMeta- Returns:
- The SQL on this database to get a list of stored procedures.
-
getReservedWords
- Specified by:
getReservedWordsin interfaceIDatabase- Overrides:
getReservedWordsin classBaseDatabaseMeta
-
getExtraOptionsHelpText
- Specified by:
getExtraOptionsHelpTextin interfaceIDatabase- Overrides:
getExtraOptionsHelpTextin classBaseDatabaseMeta
-
hasIndex
public boolean hasIndex(Database database, String schemaName, String tableName, String[] idxFields) throws HopDatabaseException Verifies on the specified database connection if an index exists on the fields with the specified name.- Specified by:
hasIndexin interfaceIDatabase- Overrides:
hasIndexin classBaseDatabaseMeta- Parameters:
database- a connected databaseschemaName-tableName-idxFields-- Returns:
- true if the index exists, false if it doesn't.
- Throws:
HopDatabaseException
-
getSqlListOfSchemas
- Specified by:
getSqlListOfSchemasin interfaceIDatabase- Overrides:
getSqlListOfSchemasin classBaseDatabaseMeta
-
isSupportsSchemas
public boolean isSupportsSchemas()- Specified by:
isSupportsSchemasin interfaceIDatabase- Overrides:
isSupportsSchemasin classBaseDatabaseMeta
-
getSqlInsertAutoIncUnknownDimensionRow
public String getSqlInsertAutoIncUnknownDimensionRow(String schemaTable, String keyField, String versionField) Get the SQL to insert a new empty unknown record in a dimension.- Specified by:
getSqlInsertAutoIncUnknownDimensionRowin interfaceIDatabase- Overrides:
getSqlInsertAutoIncUnknownDimensionRowin classBaseDatabaseMeta- Parameters:
schemaTable- the schema-table name to insert intokeyField- The key fieldversionField- the version field- Returns:
- the SQL to insert the unknown record into the SCD.
-
getSqlNextSequenceValue
- Specified by:
getSqlNextSequenceValuein interfaceIDatabase- Overrides:
getSqlNextSequenceValuein classBaseDatabaseMeta
-
getSqlCurrentSequenceValue
- Specified by:
getSqlCurrentSequenceValuein interfaceIDatabase- Overrides:
getSqlCurrentSequenceValuein classBaseDatabaseMeta
-
getSqlSequenceExists
- Specified by:
getSqlSequenceExistsin interfaceIDatabase- Overrides:
getSqlSequenceExistsin classBaseDatabaseMeta
-
isSupportsSequences
public boolean isSupportsSequences()- Specified by:
isSupportsSequencesin interfaceIDatabase- Overrides:
isSupportsSequencesin classBaseDatabaseMeta
-
isSupportsSequenceNoMaxValueOption
public boolean isSupportsSequenceNoMaxValueOption()- Specified by:
isSupportsSequenceNoMaxValueOptionin interfaceIDatabase- Overrides:
isSupportsSequenceNoMaxValueOptionin classBaseDatabaseMeta
-
getSqlListOfSequences
- Specified by:
getSqlListOfSequencesin interfaceIDatabase- Overrides:
getSqlListOfSequencesin classBaseDatabaseMeta
-
quoteSqlString
- Specified by:
quoteSqlStringin interfaceIDatabase- Overrides:
quoteSqlStringin classBaseDatabaseMeta- Parameters:
string-- Returns:
- A string that is properly quoted for use in an Oracle SQL statement (insert, update, delete, etc)
-
isUseSafePoints
public boolean isUseSafePoints()- Specified by:
isUseSafePointsin interfaceIDatabase- Overrides:
isUseSafePointsin classBaseDatabaseMeta
-
IsSupportsErrorHandlingOnBatchUpdates
public boolean IsSupportsErrorHandlingOnBatchUpdates()- Specified by:
IsSupportsErrorHandlingOnBatchUpdatesin interfaceIDatabase- Overrides:
IsSupportsErrorHandlingOnBatchUpdatesin classBaseDatabaseMeta
-
getMaxVARCHARLength
public int getMaxVARCHARLength()- Specified by:
getMaxVARCHARLengthin interfaceIDatabase- Overrides:
getMaxVARCHARLengthin classBaseDatabaseMeta
-
isMsSqlServerVariant
public boolean isMsSqlServerVariant()- Specified by:
isMsSqlServerVariantin interfaceIDatabase- Overrides:
isMsSqlServerVariantin classBaseDatabaseMeta
-
getStartQuote
- Specified by:
getStartQuotein interfaceIDatabase- Overrides:
getStartQuotein classBaseDatabaseMeta
-
getEndQuote
- Specified by:
getEndQuotein interfaceIDatabase- Overrides:
getEndQuotein classBaseDatabaseMeta
-