Package org.apache.hop.databases.oracle
Class OracleDatabaseMeta
java.lang.Object
org.apache.hop.core.database.BaseDatabaseMeta
org.apache.hop.databases.oracle.OracleDatabaseMeta
@DatabaseMetaPlugin(type="ORACLE",
typeDescription="Oracle",
documentationUrl="/database/databases/oracle.html")
@GuiPlugin(id="GUI-OracleDatabaseMeta")
public class OracleDatabaseMeta
extends BaseDatabaseMeta
implements IDatabase
Contains Oracle 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 tablegetDropTableIfExistsStatement(String tableName) Oracle does not support a construct like 'drop table if exists', which is apparently legal syntax in many other RDBMSs.getFieldDefinition(IValueMeta v, String tk, String pk, boolean useAutoinc, boolean addFieldName, boolean addCR) getLimitClause(int nrRows) intintgetModifyColumnStatement(String tableName, IValueMeta v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to modify a column in the specified tableString[]getSqlColumnExists(String columnName, String tableName) getSqlCurrentSequenceValue(String sequenceName) Get the current value of a database sequencegetSqlLockTables(String[] tableNames) getSqlNextSequenceValue(String sequenceName) Get the SQL to get the next value of a sequence.getSqlQueryColumnFields(String columnName, String tableName) getSqlQueryFields(String tableName) Returns the minimal SQL to launch in order to determine the layout of the resultset for a given database tablegetSqlSequenceExists(String sequenceName) Check if a sequence exists.getSqlTableExists(String tableName) getSqlUnlockTables(String[] tableNames) getTablespaceDDL(IVariables variables, DatabaseMeta databaseMeta, String tablespace) Returns an empty string as most databases do not support tablespaces.booleanVerifies on the specified database connection if an index exists on the fields with the specified name.booleanbooleanReturns a false as Oracle does not allow for the releasing of savepoints.booleanbooleanbooleanbooleanbooleanbooleanOracle doesn't support options in the URL, we need to put these in a Properties object at connection time...booleanMost databases allow you to retrieve result metadata by preparing a SELECT statement.booleanbooleanbooleanbooleanquoteSqlString(String string) voidsetStrictBigNumberInterpretation(boolean strictBigNumberInterpretation) booleanMethods 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, getExtraOptionIndicator, getExtraOptions, getExtraOptionSeparator, getExtraOptionValueSeparator, getFieldnameProtector, getFunctionAverage, getFunctionCount, getFunctionMaximum, getFunctionMinimum, getFunctionSum, getHostname, getIndexTablespace, getIndexTablespaceDDL, getManualUrl, getMaxTextFieldLength, getNotFoundTK, getPassword, getPluginId, getPluginName, getPort, getPreferredSchemaName, getSafeFieldname, getSchemaTableCombination, getSelectCountStatement, getSequenceNoMaxValueOption, getServername, getSqlDeleteStmt, getSqlInsertAutoIncUnknownDimensionRow, getSqlInsertClauseBeforeFields, getSqlListOfSchemas, getSqlScriptStatements, getSqlUpdateStmt, getSqlValue, getSynonymTypes, getTableTypes, getTruncateTableStatement, getUsername, getValueFromResultSet, getViewTypes, isChanged, isDefaultingToUppercase, isDisplaySizeTwiceThePrecision, isDuckDbVariant, isExasolVariant, isExplorable, isFetchSizeSupported, isForcingIdentifiersToLowerCase, isForcingIdentifiersToUpperCase, isFullExceptionLog, isInformixVariant, isMsSqlServerNativeVariant, isMsSqlServerVariant, isMySqlVariant, isNeedsPlaceHolder, isNeoviewVariant, isNetezzaVariant, isPostgresVariant, isPreserveReservedCase, isQuoteAllFields, isQuoteReservedWords, isRequiresCastToVariousForIsNull, isRequiresName, isRequiringTransactionsOnQueries, isSqliteVariant, isStreamingResults, isSupportsAutoGeneratedKeys, isSupportsBatchUpdates, isSupportsBitmapIndex, isSupportsCatalogs, isSupportsCustomDeleteStmt, isSupportsCustomUpdateStmt, isSupportsEmptyTransactions, isSupportsErrorHandling, isSupportsFloatRoundingOnUpdate, isSupportsGetBlob, isSupportsNewLinesInSql, isSupportsResultSetMetadataRetrievalOnly, isSupportsSchemas, isSupportsSetCharacterStream, isSupportsSetLong, isSupportsSetMaxRows, isSupportsTimeStampToDateConversion, isSupportsTransactions, isSupportsViews, isSybaseIQVariant, isSybaseVariant, isSystemTable, isTeradataVariant, isUseSafePoints, 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, setUsingDoubleDecimalAsSchemaTableSeparatorMethods 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, customizeValueFromSqlType, generateColumnAlias, getAccessType, getAttribute, getAttributes, getConnectSql, getCreateTableStatement, getDatabaseFactoryName, getDatabaseName, getDataTablespace, getDataTablespaceDDL, getDefaultOptions, getExtraOptionIndicator, getExtraOptions, getExtraOptionSeparator, getExtraOptionValueSeparator, getFunctionAverage, getFunctionCount, getFunctionMaximum, getFunctionMinimum, getFunctionSum, getHostname, getIndexTablespace, getIndexTablespaceDDL, getLegacyColumnName, getManualUrl, getMaxTextFieldLength, getNotFoundTK, getPassword, getPluginId, getPluginName, getPort, getPreferredSchemaName, getSafeFieldname, getSchemaTableCombination, getSelectCountStatement, getSequenceNoMaxValueOption, getServername, getSqlDeleteStmt, getSqlInsertAutoIncUnknownDimensionRow, getSqlInsertClauseBeforeFields, getSqlListOfSchemas, getSqlScriptStatements, getSqlUpdateStmt, getSqlValue, getSynonymTypes, getTableTypes, getTruncateTableStatement, getUnsupportedTableOutputMessage, getUsername, getValueFromResultSet, getViewTypes, isChanged, isDefaultingToUppercase, isDisplaySizeTwiceThePrecision, isDuckDbVariant, isExasolVariant, isExplorable, isFetchSizeSupported, isForcingIdentifiersToLowerCase, isForcingIdentifiersToUpperCase, isFullExceptionLog, isInformixVariant, isMsSqlServerNativeVariant, isMsSqlServerVariant, isMySqlVariant, isNeedsPlaceHolder, isNeoviewVariant, isNetezzaVariant, isPostgresVariant, isPreserveReservedCase, isQuoteAllFields, isQuoteReservedWords, isRequiresCastToVariousForIsNull, isRequiresName, isRequiringTransactionsOnQueries, isSqliteVariant, isStreamingResults, isSupportsAutoGeneratedKeys, isSupportsBatchUpdates, isSupportsBitmapIndex, isSupportsCatalogs, isSupportsCustomDeleteStmt, isSupportsCustomUpdateStmt, isSupportsEmptyTransactions, isSupportsErrorHandling, isSupportsFloatRoundingOnUpdate, isSupportsGetBlob, isSupportsNewLinesInSql, isSupportsResultSetMetadataRetrievalOnly, isSupportsSchemas, isSupportsSetCharacterStream, isSupportsSetLong, isSupportsSetMaxRows, isSupportsTimeStampToDateConversion, isSupportsTransactions, isSupportsViews, isSybaseIQVariant, isSybaseVariant, isSystemTable, isTeradataVariant, isUseSafePoints, 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
-
Field Details
-
CONST_SELECT
- See Also:
-
CONST_JDBC_ORACLE_THIN
- See Also:
-
-
Constructor Details
-
OracleDatabaseMeta
public OracleDatabaseMeta()
-
-
Method Details
-
getAccessTypeList
public int[] getAccessTypeList()- Specified by:
getAccessTypeListin interfaceIDatabase- Specified by:
getAccessTypeListin classBaseDatabaseMeta
-
getDefaultDatabasePort
public int getDefaultDatabasePort()- Specified by:
getDefaultDatabasePortin interfaceIDatabase- Overrides:
getDefaultDatabasePortin classBaseDatabaseMeta
-
isSupportsAutoInc
public boolean isSupportsAutoInc()- Specified by:
isSupportsAutoIncin interfaceIDatabase- Overrides:
isSupportsAutoIncin classBaseDatabaseMeta- Returns:
- Whether or not the database can use auto increment type of fields (pk)
-
getLimitClause
- Specified by:
getLimitClausein interfaceIDatabase- Overrides:
getLimitClausein classBaseDatabaseMeta- See Also:
-
getSqlQueryFields
Returns the minimal SQL to launch in order to determine the layout of the resultset for a given database table- Specified by:
getSqlQueryFieldsin interfaceIDatabase- Overrides:
getSqlQueryFieldsin classBaseDatabaseMeta- Parameters:
tableName- The name of the table to determine the layout for- Returns:
- The SQL to launch.
-
getSqlTableExists
- Specified by:
getSqlTableExistsin interfaceIDatabase- Overrides:
getSqlTableExistsin classBaseDatabaseMeta
-
getSqlColumnExists
- Specified by:
getSqlColumnExistsin interfaceIDatabase- Overrides:
getSqlColumnExistsin classBaseDatabaseMeta
-
getSqlQueryColumnFields
-
getDriverClass
- Specified by:
getDriverClassin interfaceIDatabase
-
getURL
- Specified by:
getURLin interfaceIDatabase- Throws:
HopDatabaseException
-
isSupportsOptionsInURL
public boolean isSupportsOptionsInURL()Oracle doesn't support options in the URL, we need to put these in a Properties object at connection time...- Specified by:
isSupportsOptionsInURLin interfaceIDatabase- Overrides:
isSupportsOptionsInURLin classBaseDatabaseMeta
-
isSupportsSequences
public boolean isSupportsSequences()- Specified by:
isSupportsSequencesin interfaceIDatabase- Overrides:
isSupportsSequencesin classBaseDatabaseMeta- Returns:
- true if the database supports sequences
-
getSqlSequenceExists
Check if a sequence exists.- Specified by:
getSqlSequenceExistsin interfaceIDatabase- Overrides:
getSqlSequenceExistsin classBaseDatabaseMeta- Parameters:
sequenceName- The sequence to check- Returns:
- The SQL to get the name of the sequence back from the databases data dictionary
-
getSqlCurrentSequenceValue
Get the current value of a database sequence- Specified by:
getSqlCurrentSequenceValuein interfaceIDatabase- Overrides:
getSqlCurrentSequenceValuein classBaseDatabaseMeta- Parameters:
sequenceName- The sequence to check- Returns:
- The current value of a database sequence
-
getSqlNextSequenceValue
Get the SQL to get the next value of a sequence. (Oracle only)- Specified by:
getSqlNextSequenceValuein interfaceIDatabase- Overrides:
getSqlNextSequenceValuein classBaseDatabaseMeta- Parameters:
sequenceName- The sequence name- Returns:
- the SQL to get the next value of a sequence. (Oracle only)
-
isSupportsSequenceNoMaxValueOption
public boolean isSupportsSequenceNoMaxValueOption()- Specified by:
isSupportsSequenceNoMaxValueOptionin interfaceIDatabase- Overrides:
isSupportsSequenceNoMaxValueOptionin classBaseDatabaseMeta
-
useSchemaNameForTableList
public boolean useSchemaNameForTableList()- Specified by:
useSchemaNameForTableListin interfaceIDatabase- Overrides:
useSchemaNameForTableListin classBaseDatabaseMeta- Returns:
- true if we need to supply the schema-name to getTables in order to get a correct list of items.
-
isSupportsSynonyms
public boolean isSupportsSynonyms()- Specified by:
isSupportsSynonymsin interfaceIDatabase- Overrides:
isSupportsSynonymsin classBaseDatabaseMeta- Returns:
- true if the database supports synonyms
-
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
-
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
-
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
-
getFieldDefinition
public String getFieldDefinition(IValueMeta v, String tk, String pk, boolean useAutoinc, boolean addFieldName, boolean addCR) - Specified by:
getFieldDefinitionin interfaceIDatabase
-
getReservedWords
- Specified by:
getReservedWordsin interfaceIDatabase- Overrides:
getReservedWordsin classBaseDatabaseMeta
-
getSqlListOfProcedures
- Specified by:
getSqlListOfProceduresin interfaceIDatabase- Overrides:
getSqlListOfProceduresin classBaseDatabaseMeta- Returns:
- The SQL on this database to get a list of stored procedures.
-
getSqlLockTables
- Specified by:
getSqlLockTablesin interfaceIDatabase- Overrides:
getSqlLockTablesin classBaseDatabaseMeta
-
getSqlUnlockTables
- Specified by:
getSqlUnlockTablesin interfaceIDatabase- Overrides:
getSqlUnlockTablesin classBaseDatabaseMeta
-
getExtraOptionsHelpText
- Specified by:
getExtraOptionsHelpTextin interfaceIDatabase- Overrides:
getExtraOptionsHelpTextin classBaseDatabaseMeta- Returns:
- extra help text on the supported options on the selected database platform.
-
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
-
isRequiresCreateTablePrimaryKeyAppend
public boolean isRequiresCreateTablePrimaryKeyAppend()- Specified by:
isRequiresCreateTablePrimaryKeyAppendin interfaceIDatabase- Overrides:
isRequiresCreateTablePrimaryKeyAppendin classBaseDatabaseMeta
-
isSupportsPreparedStatementMetadataRetrieval
public boolean isSupportsPreparedStatementMetadataRetrieval()Most databases allow you to retrieve result metadata by preparing a SELECT statement.- Specified by:
isSupportsPreparedStatementMetadataRetrievalin interfaceIDatabase- Overrides:
isSupportsPreparedStatementMetadataRetrievalin classBaseDatabaseMeta- Returns:
- true if the database supports retrieval of query metadata from a prepared statement. False if the query needs to be executed first.
-
getMaxColumnsInIndex
public int getMaxColumnsInIndex()- Specified by:
getMaxColumnsInIndexin interfaceIDatabase- Overrides:
getMaxColumnsInIndexin classBaseDatabaseMeta- Returns:
- The maximum number of columns in a database, <=0 means: no known limit
-
getSqlListOfSequences
- Specified by:
getSqlListOfSequencesin interfaceIDatabase- Overrides:
getSqlListOfSequencesin classBaseDatabaseMeta- Returns:
- The SQL on this database to get a list of sequences.
-
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)
-
isReleaseSavepoint
public boolean isReleaseSavepoint()Returns a false as Oracle does not allow for the releasing of savepoints.- Specified by:
isReleaseSavepointin interfaceIDatabase- Overrides:
isReleaseSavepointin classBaseDatabaseMeta
-
getTablespaceDDL
Returns an empty string as most databases do not support tablespaces. Subclasses can override this method to generate the DDL.- Overrides:
getTablespaceDDLin classBaseDatabaseMeta- Parameters:
variables- variables needed for variable substitution.databaseMeta- databaseMeta needed for it's quoteField method. Since we are doing variable substitution we need to meta so that we can act on the variable substitution first and then the creation of the entire string that will be retuned.tablespace- tablespaceName name of the tablespace.- Returns:
- String the TABLESPACE tablespaceName section of an Oracle CREATE DDL statement.
-
IsSupportsErrorHandlingOnBatchUpdates
public boolean IsSupportsErrorHandlingOnBatchUpdates()- Specified by:
IsSupportsErrorHandlingOnBatchUpdatesin interfaceIDatabase- Overrides:
IsSupportsErrorHandlingOnBatchUpdatesin classBaseDatabaseMeta
-
getMaxVARCHARLength
public int getMaxVARCHARLength()- Specified by:
getMaxVARCHARLengthin interfaceIDatabase- Overrides:
getMaxVARCHARLengthin classBaseDatabaseMeta
-
getDropTableIfExistsStatement
Oracle does not support a construct like 'drop table if exists', which is apparently legal syntax in many other RDBMSs. So we need to implement the same behavior and avoid throwing 'table does not exist' exception.- Specified by:
getDropTableIfExistsStatementin interfaceIDatabase- Overrides:
getDropTableIfExistsStatementin classBaseDatabaseMeta- Parameters:
tableName- Name of the table to drop- Returns:
- 'drop table if exists'-like statement for Oracle
-
createSqlScriptParser
- Specified by:
createSqlScriptParserin interfaceIDatabase
-
isStrictBigNumberInterpretation
public boolean isStrictBigNumberInterpretation()- Specified by:
isStrictBigNumberInterpretationin interfaceIDatabase- Overrides:
isStrictBigNumberInterpretationin classBaseDatabaseMeta- Returns:
- true if using strict number(38) interpretation
-
setStrictBigNumberInterpretation
public void setStrictBigNumberInterpretation(boolean strictBigNumberInterpretation) - Parameters:
strictBigNumberInterpretation- true if use strict number(38) interpretation
-
isOracleVariant
public boolean isOracleVariant()- Specified by:
isOracleVariantin interfaceIDatabase- Overrides:
isOracleVariantin classBaseDatabaseMeta
-
getStartQuote
- Specified by:
getStartQuotein interfaceIDatabase- Overrides:
getStartQuotein classBaseDatabaseMeta
-
getEndQuote
- Specified by:
getEndQuotein interfaceIDatabase- Overrides:
getEndQuotein classBaseDatabaseMeta
-
isSupportsBooleanDataType
public boolean isSupportsBooleanDataType()- Specified by:
isSupportsBooleanDataTypein interfaceIDatabase- Overrides:
isSupportsBooleanDataTypein classBaseDatabaseMeta
-
isSupportsTimestampDataType
public boolean isSupportsTimestampDataType()- Specified by:
isSupportsTimestampDataTypein interfaceIDatabase- Overrides:
isSupportsTimestampDataTypein classBaseDatabaseMeta
-