Package org.pentaho.di.core.database
Interface DatabaseInterface
- All Superinterfaces:
Cloneable
- All Known Subinterfaces:
DatabaseInterfaceExtended
- All Known Implementing Classes:
AS400DatabaseMeta
,AthenaDatabaseMeta
,AzureSqlDataBaseMeta
,BaseDatabaseMeta
,CacheDatabaseMeta
,DatabricksDatabaseMeta
,DB2DatabaseMeta
,DbaseDatabaseMeta
,DerbyDatabaseMeta
,Exasol4DatabaseMeta
,ExtenDBDatabaseMeta
,FirebirdDatabaseMeta
,GenericDatabaseMeta
,GoogleBigQueryDatabaseMeta
,GreenplumDatabaseMeta
,GuptaDatabaseMeta
,H2DatabaseMeta
,HypersonicDatabaseMeta
,InfiniDbDatabaseMeta
,InfobrightDatabaseMeta
,InformixDatabaseMeta
,IngresDatabaseMeta
,InterbaseDatabaseMeta
,KingbaseESDatabaseMeta
,LucidDBDatabaseMeta
,MariaDBDatabaseMeta
,MondrianNativeDatabaseMeta
,MonetDBDatabaseMeta
,MSAccessDatabaseMeta
,MSSQLServerDatabaseMeta
,MSSQLServerNativeDatabaseMeta
,MySQLDatabaseMeta
,NeoviewDatabaseMeta
,NetezzaDatabaseMeta
,OracleDatabaseMeta
,OracleRDBDatabaseMeta
,PostgreSQLDatabaseMeta
,RedshiftDatabaseMeta
,RemedyActionRequestSystemDatabaseMeta
,SAPDBDatabaseMeta
,SnowflakeHVDatabaseMeta
,SQLiteDatabaseMeta
,SybaseDatabaseMeta
,SybaseIQDatabaseMeta
,TeradataDatabaseMeta
,UniVerseDatabaseMeta
,VectorWiseDatabaseMeta
,Vertica5DatabaseMeta
,VerticaDatabaseMeta
This interface describes the methods that a database connection needs to have in order to describe it properly.
- Since:
- 11-mrt-2005
- Author:
- Matt
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addAttribute
(String attributeId, String value) Add extra attribute on this connectiondefault void
Deprecated.No longer works with the UI, Use getDefaultOptions, insteadvoid
addExtraOption
(String databaseTypeCode, String option, String value) Add an extra option to the attributes listboolean
checkIndexExists
(Database database, String schemaName, String tableName, String[] idxFields) Verifies on the specified database connection if an index exists on the fields with the specified name.clone()
Clone this database interface: copy all info to a new objectdefault SqlScriptParser
Create SqlScriptParser for current database dialectcustomizeValueFromSQLType
(ValueMetaInterface v, ResultSetMetaData rm, int index) Customizes the ValueMetaInterface defined in the basegenerateColumnAlias
(int columnIndex, String suggestedName) Generate a column alias given the column index and suggested name.int
int[]
Get the list of possible access types for a database.getAddColumnStatement
(String tablename, ValueMetaInterface v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to add a column to the specified tabledefault String
getAttribute
(String attributeId, String defaultValue) Gets an attribute from the connectionCustomizes the ValueMetaInterface defined in the baseYou can use this method to supply an alternate factory for the test method in the dialogs.getDataTablespaceDDL
(VariableSpace variables, DatabaseMeta databaseMeta) Returns the tablespace DDL fragment for a "Data" tablespace.int
Obtain the name of the JDBC driver class that we need to use!getDropColumnStatement
(String tablename, ValueMetaInterface v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to drop a column from the specified tablegetFieldDefinition
(ValueMetaInterface v, String tk, String pk, boolean useAutoinc, boolean addFieldName, boolean addCr) Describe a Value as a field in the database.getIndexTablespaceDDL
(VariableSpace variables, DatabaseMeta databaseMeta) Returns the tablespace DDL fragment for a "Index" tablespace.int
default String
getLegacyColumnName
(DatabaseMetaData dbMetaData, ResultSetMetaData rsMetaData, int index) Allows to get the column name for JDBC drivers with different behavior for aliases depending on the connector version.getLimitClause
(int nrRows) int
int
int
Get the maximum length of a text field for this database connection.int
Get the maximum length of a text field (VARCHAR) for this database connection.getModifyColumnStatement
(String tablename, ValueMetaInterface v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to modify a column in the specified tablegetName()
default String
getNextBatchId
(DatabaseMeta dbm, Database ldb, String schemaName, String tableName, String fieldName) Get the next Batch ID from the logging tables.int
getNotFoundTK
(boolean useAutoinc) Get the not found technical key.String[]
getSafeFieldname
(String fieldName) Given a String, this will sanitize and return a value safe for usage as a column namedefault ResultSet
getSchemas
(DatabaseMetaData databaseMetaData, DatabaseMeta dbMeta) getSchemaTableCombination
(String schemaName, String tablePart) Get the schema-table combination to query the right table.getSelectCountStatement
(String tableName) Returns the SQL Statement that counts the number of rows in the table.getSQLColumnExists
(String column, String tablename) getSQLCurrentSequenceValue
(String sequenceName) Get the current value of a database sequencegetSQLInsertAutoIncUnknownDimensionRow
(String schemaTable, String keyField, String versionField) Get the SQL to insert a new empty unknown record in a dimension.default String
getSQLListOfSchemas
(DatabaseMeta dbMeta) getSQLLockTables
(String[] tableNames) getSQLNextSequenceValue
(String sequenceName) Get the SQL to get the next value of a sequence.getSQLQueryFields
(String tableName) Returns the minimal SQL to launch in order to determine the layout of the resultset for a given database tablegetSqlScriptStatements
(String sqlScript) Parse the statements in the provided SQL script, provide more information about where each was found in the script.getSQLSequenceExists
(String sequenceName) Check if a sequence exists.getSQLTableExists
(String tablename) getSQLUnlockTables
(String[] tableNames) getSQLValue
(ValueMetaInterface valueMeta, Object valueData, String dateFormat) Convert a value in the SQL equivalent.String[]
default ResultSet
getTables
(DatabaseMetaData databaseMetaData, DatabaseMeta dbMeta, String schemaPattern, String tableNamePattern, String[] tableTypes) String[]
getTruncateTableStatement
(String tableName) default String
String[]
getValueFromResultSet
(ResultSet resultSet, ValueMetaInterface valueMeta, int index) This method allows a database dialect to convert database specific data types to Kettle data types.String[]
boolean
boolean
boolean
boolean
boolean
Checks whether or not the command setFetchSize() is supported by the JDBC driver...boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isSystemTable
(String tableName) boolean
boolean
boolean
Indicates the need to insert a placeholder (0) for auto increment fields.boolean
parseStatements
(String sqlScript) Parse all possible statements from the provided SQL script.boolean
default void
putOptionalOptions
(Map<String, String> extraOptions) boolean
quoteSQLString
(String string) Adds quotes around the string according to the database dialect and also escapes special characters like CR, LF and the quote character itself.boolean
Returns a true of savepoints can be release, false if not.boolean
boolean
void
setAccessType
(int accessType) void
setAttributes
(Properties attributes) Set extra attributes on this database connectionvoid
setChanged
(boolean changed) void
setConnectionPoolingProperties
(Properties properties) set the connection pooling propertiesvoid
setConnectSQL
(String sql) void
setDatabaseName
(String databaseName) void
setDatabasePortNumberString
(String databasePortNumberString) void
setDataTablespace
(String dataTablespace) void
setDisplayName
(String displayName) void
setForcingIdentifiersToLowerCase
(boolean forceLowerCase) void
setForcingIdentifiersToUpperCase
(boolean forceUpperCase) void
setHostname
(String hostname) void
setIndexTablespace
(String indexTablespace) void
setInitialPoolSize
(int initalPoolSize) void
setInitialPoolSizeString
(String initialPoolSize) void
setMaximumPoolSize
(int maximumPoolSize) void
setMaximumPoolSizeString
(String maximumPoolSize) void
default void
setNamedCluster
(String namedCluster) Set the hadoop cluster associated with the connectionvoid
setObjectId
(ObjectId id) void
setPartitioned
(boolean partitioned) void
setPartitioningInformation
(PartitionDatabaseMeta[] partitionInfo) void
setPassword
(String password) void
setPluginId
(String pluginId) void
setPluginName
(String pluginName) void
setPreferredSchemaName
(String preferredSchemaName) void
setPreserveReservedCase
(boolean b) void
setQuoteAllFields
(boolean quoteAllFields) void
setServername
(String servername) void
setStreamingResults
(boolean useStreaming) void
setSupportsBooleanDataType
(boolean b) void
setSupportsTimestampDataType
(boolean b) void
setUsername
(String username) void
setUsingConnectionPool
(boolean usePool) void
setUsingDoubleDecimalAsSchemaTableSeparator
(boolean useDoubleDecimalSeparator) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
default boolean
boolean
boolean
boolean
Most databases allow you to retrieve result metadata by preparing a SELECT statement.boolean
boolean
boolean
boolean
boolean
boolean
See if this database supports the setCharacterStream() method on a PreparedStatement.boolean
boolean
default boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
-
Method Details
-
getPluginId
String getPluginId()- Returns:
- the plugin id of this database
-
setPluginId
- Parameters:
pluginId
- set the plugin id of this plugin (after instantiation)
-
getPluginName
String getPluginName()- Returns:
- the plugin name of this database, the same thing as the annotation typeDescription
-
setPluginName
- Parameters:
pluginName
- set the plugin name of this plugin (after instantiation)
-
getAccessType
int getAccessType()- Returns:
- Returns the accessType.
-
setAccessType
void setAccessType(int accessType) - Parameters:
accessType
- The accessType to set.
-
isChanged
boolean isChanged()- Returns:
- Returns the changed.
-
setChanged
void setChanged(boolean changed) - Parameters:
changed
- The changed to set.
-
getName
String getName()- Returns:
- Returns the connection Name.
-
setName
- Parameters:
name
- The connection Name to set.
-
getDisplayName
String getDisplayName()- Returns:
- Returns the un-escaped connection Name.
-
setDisplayName
- Parameters:
displayName
- The un-escaped connection Name to set.
-
getDatabaseName
String getDatabaseName()- Returns:
- Returns the databaseName.
-
setDatabaseName
- Parameters:
databaseName
- The databaseName to set.
-
getDatabasePortNumberString
String getDatabasePortNumberString()- Returns:
- Returns the databasePortNumber as a string.
-
setDatabasePortNumberString
- Parameters:
databasePortNumberString
- The databasePortNumber to set as a string.
-
getHostname
String getHostname()- Returns:
- Returns the hostname.
-
setHostname
- Parameters:
hostname
- The hostname to set.
-
getObjectId
ObjectId getObjectId()- Returns:
- Returns the id.
-
setObjectId
- Parameters:
id
- The id to set.
-
getUsername
String getUsername()- Returns:
- the username to log onto the database
-
setUsername
- Parameters:
username
- Sets the username to log onto the database with.
-
getPassword
String getPassword()- Returns:
- Returns the password.
-
setPassword
- Parameters:
password
- The password to set.
-
getServername
String getServername()- Returns:
- Returns the servername.
-
setServername
- Parameters:
servername
- The servername to set.
-
getDataTablespace
String getDataTablespace()- Returns:
- the tablespace to store data in. (create table)
-
setDataTablespace
- Parameters:
dataTablespace
- the tablespace to store data in
-
getIndexTablespace
String getIndexTablespace()- Returns:
- the tablespace to store indexes in
-
setIndexTablespace
- Parameters:
indexTablespace
- the tablespace to store indexes in
-
getAttributes
Properties getAttributes()- Returns:
- The extra attributes for this database connection
-
setAttributes
Set extra attributes on this database connection- Parameters:
attributes
- The extra attributes to set on this database connection.
-
addAttribute
Add extra attribute on this connection- Parameters:
attributeId
- the attribute identifiervalue
- the value of the attribute
-
getAttribute
Gets an attribute from the connection- Parameters:
attributeId
- the attribute identifierdefaultValue
- the default value in case the attribute is not found- Returns:
- the attribute value
-
supportsSetCharacterStream
boolean supportsSetCharacterStream()See if this database supports the setCharacterStream() method on a PreparedStatement.- Returns:
- true if we can set a Stream on a field in a PreparedStatement. False if not.
-
supportsAutoInc
boolean supportsAutoInc()- Returns:
- Whether or not the database can use auto increment type of fields (pk)
-
getFieldDefinition
String getFieldDefinition(ValueMetaInterface v, String tk, String pk, boolean useAutoinc, boolean addFieldName, boolean addCr) Describe a Value as a field in the database.- Parameters:
v
- The value to describetk
- The field that's going to be the technical keypk
- The field that's going to be the primary keyuseAutoinc
- Use autoincrement or notaddFieldName
- Add the fieldname to the definition or notaddCr
- Add a cariage return at the end of the definition or not.- Returns:
- a value described as a field in this database.
-
getAccessTypeList
int[] getAccessTypeList()Get the list of possible access types for a database.- Returns:
- the list of possible access types for a database.
-
getDefaultDatabasePort
int getDefaultDatabasePort()- Returns:
- the default database port number
-
getDefaultOptions
- Returns:
- default extra Options
-
getLimitClause
- Parameters:
nrRows
- The number of rows to which we want to limit the result of the query.- Returns:
- the clause after a select statement to limit the number of rows
-
getSQLQueryFields
Returns the minimal SQL to launch in order to determine the layout of the resultset for a given database table- Parameters:
tableName
- The name of the table to determine the layout for- Returns:
- The SQL to launch.
-
getNotFoundTK
int getNotFoundTK(boolean useAutoinc) Get the not found technical key.- Parameters:
useAutoinc
- Whether or not we want to use an auto increment field- Returns:
- the lowest possible technical key to be used as the NOT FOUND row in a slowly changing dimension.
-
getDriverClass
String getDriverClass()Obtain the name of the JDBC driver class that we need to use!- Returns:
- the name of the JDBC driver class for the specific database
-
getURL
- Parameters:
hostname
- the hostnameport
- the port as a stringdatabaseName
- the database name- Returns:
- the URL to use for connecting to the database.
- Throws:
KettleDatabaseException
- in case a configuration error is detected.
-
supportsSequences
boolean supportsSequences()- Returns:
- true if the database supports sequences
-
getSQLNextSequenceValue
Get the SQL to get the next value of a sequence.- Parameters:
sequenceName
- The sequence name- Returns:
- the SQL to get the next value of a sequence.
-
getSQLCurrentSequenceValue
Get the current value of a database sequence- Parameters:
sequenceName
- The sequence to check- Returns:
- The current value of a database sequence
-
getSQLSequenceExists
Check if a sequence exists.- Parameters:
sequenceName
- The sequence to check- Returns:
- The SQL to get the name of the sequence back from the databases data dictionary
-
isFetchSizeSupported
boolean isFetchSizeSupported()Checks whether or not the command setFetchSize() is supported by the JDBC driver...- Returns:
- true is setFetchSize() is supported!
-
supportsTransactions
boolean supportsTransactions()- Returns:
- true if the database supports transactions.
-
supportsBitmapIndex
boolean supportsBitmapIndex()- Returns:
- true if the database supports bitmap indexes
-
supportsIndexes
default boolean supportsIndexes()- Returns:
- true if the database supports indexes at all. (Exasol and Snowflake do not)
-
supportsSetLong
boolean supportsSetLong()- Returns:
- true if the database JDBC driver supports the setLong command
-
supportsSchemas
boolean supportsSchemas()- Returns:
- true if the database supports schemas
-
supportsCatalogs
boolean supportsCatalogs()- Returns:
- true if the database supports catalogs
-
supportsEmptyTransactions
boolean supportsEmptyTransactions()- Returns:
- true when the database engine supports empty transaction. (for example Informix does not!)
-
needsPlaceHolder
boolean needsPlaceHolder()Indicates the need to insert a placeholder (0) for auto increment fields.- Returns:
- true if we need a placeholder for auto increment fields in insert statements.
-
getFunctionSum
String getFunctionSum()- Returns:
- the function for Sum agrregate
-
getFunctionAverage
String getFunctionAverage()- Returns:
- the function for Average agrregate
-
getFunctionMinimum
String getFunctionMinimum()- Returns:
- the function for Minimum agrregate
-
getFunctionMaximum
String getFunctionMaximum()- Returns:
- the function for Maximum agrregate
-
getFunctionCount
String getFunctionCount()- Returns:
- the function for Count agrregate
-
getSchemaTableCombination
Get the schema-table combination to query the right table. Usually that is SCHEMA.TABLENAME, however there are exceptions to this rule...- Parameters:
schemaName
- The schema nametablePart
- The tablename- Returns:
- the schema-table combination to query the right table.
-
getMaxTextFieldLength
int getMaxTextFieldLength()Get the maximum length of a text field for this database connection. This includes optional CLOB, Memo and Text fields. (the maximum!)- Returns:
- The maximum text field length for this database type. (mostly CLOB_LENGTH)
-
getMaxVARCHARLength
int getMaxVARCHARLength()Get the maximum length of a text field (VARCHAR) for this database connection. If this size is exceeded use a CLOB.- Returns:
- The maximum VARCHAR field length for this database type. (mostly identical to getMaxTextFieldLength() - CLOB_LENGTH)
-
getAddColumnStatement
String getAddColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to add a column to the specified table- 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
String getDropColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to drop a column from the specified table- 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
String getModifyColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean useAutoinc, String pk, boolean semicolon) Generates the SQL statement to modify a column in the specified table- 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
-
clone
Object clone()Clone this database interface: copy all info to a new object- Returns:
- the cloned Database Interface object.
-
getReservedWords
String[] getReservedWords()- Returns:
- an array of reserved words for the database type...
-
quoteReservedWords
boolean quoteReservedWords()- Returns:
- true if reserved words need to be double quoted ("password", "select", ...)
-
getStartQuote
String getStartQuote()- Returns:
- The start quote sequence, mostly just double quote, but sometimes [, ...
-
getEndQuote
String getEndQuote()- Returns:
- The end quote sequence, mostly just double quote, but sometimes ], ...
-
supportsRepository
boolean supportsRepository()- Returns:
- true if Kettle can create a repository on this type of database.
-
getTableTypes
String[] getTableTypes()- Returns:
- a list of table types to retrieve tables for the database This is mostly just { "TABLE" }
-
getViewTypes
String[] getViewTypes()- Returns:
- a list of table types to retrieve views for the database This is mostly just { "VIEW" }
-
getSynonymTypes
String[] getSynonymTypes()- Returns:
- a list of table types to retrieve synonyms for the database
-
useSchemaNameForTableList
boolean useSchemaNameForTableList()- Returns:
- true if we need to supply the schema-name to getTables in order to get a correct list of items.
-
supportsViews
boolean supportsViews()- Returns:
- true if the database supports views
-
supportsSynonyms
boolean supportsSynonyms()- Returns:
- true if the database supports synonyms
-
getSQLListOfProcedures
String getSQLListOfProcedures()- Returns:
- The SQL on this database to get a list of stored procedures.
-
getTruncateTableStatement
- Parameters:
tableName
- The table to be truncated.- Returns:
- The SQL statement to truncate a table: remove all rows from it without a transaction
-
supportsFloatRoundingOnUpdate
boolean supportsFloatRoundingOnUpdate()- Returns:
- true if the database rounds floating point numbers to the right precision. For example if the target field is number(7,2) the value 12.399999999 is converted into 12.40
-
getSQLLockTables
- 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.
-
getSQLUnlockTables
- Parameters:
tableNames
- The names of the tables to unlock- Returns:
- The SQL command to unlock the database tables. null is returned in case locking is not supported on the target database.
-
supportsTimeStampToDateConversion
boolean supportsTimeStampToDateConversion()- Returns:
- true if the database resultsets support getTimeStamp() to retrieve date-time. (Date)
-
supportsBatchUpdates
boolean supportsBatchUpdates()- Returns:
- true if the database JDBC driver supports batch updates For example Interbase doesn't support this!
-
supportsBooleanDataType
boolean supportsBooleanDataType()- Returns:
- true if the database supports a boolean, bit, logical, ... datatype
-
setSupportsBooleanDataType
void setSupportsBooleanDataType(boolean b) - Parameters:
b
- Set to true if the database supports a boolean, bit, logical, ... datatype
-
preserveReservedCase
boolean preserveReservedCase()- Returns:
- true if reserved words' case should be preserved
-
setPreserveReservedCase
void setPreserveReservedCase(boolean b) - Parameters:
b
- Set to true if reserved words' case should be preserved
-
isDefaultingToUppercase
boolean isDefaultingToUppercase()- Returns:
- true if the database defaults to naming tables and fields in upper case. True for most databases except for stuborn stuff like Postgres ;-)
-
getExtraOptions
- Returns:
- a map of all the extra URL options you want to set, retrieved from the attributes list (NOT synchronized!)
-
addExtraOption
Add an extra option to the attributes list- Parameters:
databaseTypeCode
- The database type code for which the option appliesoption
- The option to setvalue
- The value of the option
-
getExtraOptionSeparator
String getExtraOptionSeparator()- Returns:
- The extra option separator in database URL for this platform (usually this is semicolon ; )
-
getExtraOptionValueSeparator
String getExtraOptionValueSeparator()- Returns:
- The extra option value separator in database URL for this platform (usually this is the equal sign = )
-
getExtraOptionIndicator
String getExtraOptionIndicator()- Returns:
- This indicator separates the normal URL from the options
-
supportsOptionsInURL
boolean supportsOptionsInURL()- Returns:
- true if the database supports connection options in the URL, false if they are put in a Properties object.
-
getExtraOptionsHelpText
String getExtraOptionsHelpText()- Returns:
- extra help text on the supported options on the selected database platform.
-
supportsGetBlob
boolean supportsGetBlob()- Returns:
- true if the database JDBC driver supports getBlob on the resultset. If not we must use getBytes() to get the data.
-
getConnectSQL
String getConnectSQL()- Returns:
- The SQL to execute right after connecting
-
setConnectSQL
- Parameters:
sql
- The SQL to execute right after connecting
-
supportsSetMaxRows
boolean supportsSetMaxRows()- Returns:
- true if the database supports setting the maximum number of return rows in a resultset.
-
isUsingConnectionPool
boolean isUsingConnectionPool()- Returns:
- true if we want to use a database connection pool
-
setUsingConnectionPool
void setUsingConnectionPool(boolean usePool) - Parameters:
usePool
- true if we want to use a database connection pool
-
getMaximumPoolSize
int getMaximumPoolSize()- Returns:
- the maximum pool size
-
getMaximumPoolSizeString
String getMaximumPoolSizeString()- Returns:
- the maximum pool size variable name
-
setMaximumPoolSize
void setMaximumPoolSize(int maximumPoolSize) - Parameters:
maximumPoolSize
- the maximum pool size
-
setMaximumPoolSizeString
- Parameters:
maximumPoolSize
- the maximum pool size variable name
-
getInitialPoolSize
int getInitialPoolSize()- Returns:
- the initial pool size
-
getInitialPoolSizeString
String getInitialPoolSizeString()- Returns:
- the initial pool size variable name
-
setInitialPoolSize
void setInitialPoolSize(int initalPoolSize) - Parameters:
initalPoolSize
- the initial pool size
-
setInitialPoolSizeString
- Parameters:
initialPoolSize
- the initial pool size variable name
-
isPartitioned
boolean isPartitioned()- Returns:
- true if the connection contains partitioning information
-
setPartitioned
void setPartitioned(boolean partitioned) - Parameters:
partitioned
- true if the connection is set to contain partitioning information
-
getPartitioningInformation
PartitionDatabaseMeta[] getPartitioningInformation()- Returns:
- the available partition/host/databases/port combinations in the cluster
-
setPartitioningInformation
- Parameters:
partitionInfo
- the available partition/host/databases/port combinations in the cluster
-
getUsedLibraries
String[] getUsedLibraries()- Returns:
- the required libraries (in lib) for this database connection.
-
getConnectionPoolingProperties
Properties getConnectionPoolingProperties()- Returns:
- The set of properties that allows you to set the connection pooling parameters
-
setConnectionPoolingProperties
set the connection pooling properties -
getSQLTableExists
- Parameters:
tablename
- The table to verify the existance for- Returns:
- The SQL to execute to verify if the given table exists. If an Exception is thrown for this SQL, we don't have the table.
-
getSQLColumnExists
- Parameters:
column
- The column to verify the existance fortablename
- The table to verify the existance for- Returns:
- The SQL to execute to verify if the given table exists. If an Exception is thrown for this SQL, we don't have the column.
-
needsToLockAllTables
boolean needsToLockAllTables()- Returns:
- true if the database needs all repository tables to be locked, not just one ref table (R_REPOSITORY_LOG)
-
isStreamingResults
boolean isStreamingResults()- Returns:
- true if the database is streaming results (normally this is an option just for MySQL).
-
setStreamingResults
void setStreamingResults(boolean useStreaming) - Parameters:
useStreaming
- true if we want the database to stream results (normally this is an option just for MySQL).
-
isQuoteAllFields
boolean isQuoteAllFields()- Returns:
- true if all fields should always be quoted in db
-
setQuoteAllFields
void setQuoteAllFields(boolean quoteAllFields) - Parameters:
quoteAllFields
- true if all fields in DB should be quoted.
-
isForcingIdentifiersToLowerCase
boolean isForcingIdentifiersToLowerCase()- Returns:
- true if all identifiers should be forced to lower case
-
setForcingIdentifiersToLowerCase
void setForcingIdentifiersToLowerCase(boolean forceLowerCase) - Parameters:
forceLowerCase
- true if all identifiers should be forced to lower case
-
isForcingIdentifiersToUpperCase
boolean isForcingIdentifiersToUpperCase()- Returns:
- true if all identifiers should be forced to upper case
-
setForcingIdentifiersToUpperCase
void setForcingIdentifiersToUpperCase(boolean forceUpperCase) - Parameters:
forceUpperCase
- true if all identifiers should be forced to upper case
-
isUsingDoubleDecimalAsSchemaTableSeparator
boolean isUsingDoubleDecimalAsSchemaTableSeparator()- Returns:
- true if we use a double decimal separator to specify schema/table combinations on MS-SQL server
-
setUsingDoubleDecimalAsSchemaTableSeparator
void setUsingDoubleDecimalAsSchemaTableSeparator(boolean useDoubleDecimalSeparator) - Parameters:
useDoubleDecimalSeparator
- true if we should use a double decimal separator to specify schema/table combinations on MS-SQL server
-
isRequiringTransactionsOnQueries
boolean isRequiringTransactionsOnQueries()- Returns:
- true if this database needs a transaction to perform a query (auto-commit turned off).
-
getDatabaseFactoryName
String getDatabaseFactoryName()You can use this method to supply an alternate factory for the test method in the dialogs. This is useful for plugins like SAP/R3 and PALO.- Returns:
- the name of the database test factory to use.
-
getPreferredSchemaName
String getPreferredSchemaName()- Returns:
- The preferred schema name of this database connection.
-
setPreferredSchemaName
- Parameters:
preferredSchemaName
- The preferred schema name of this database connection.
-
checkIndexExists
boolean checkIndexExists(Database database, String schemaName, String tableName, String[] idxFields) throws KettleDatabaseException Verifies on the specified database connection if an index exists on the fields with the specified name.- Parameters:
database
-schemaName
-tableName
-idxFields
-- Returns:
- Throws:
KettleDatabaseException
-
supportsSequenceNoMaxValueOption
boolean supportsSequenceNoMaxValueOption()- Returns:
- true if the database supports sequences with a maximum value option. The default is true.
-
requiresCreateTablePrimaryKeyAppend
boolean requiresCreateTablePrimaryKeyAppend()- Returns:
- true if we need to append the PRIMARY KEY block in the create table block after the fields, required for Cache.
-
requiresCastToVariousForIsNull
boolean requiresCastToVariousForIsNull()- Returns:
- true if the database requires you to cast a parameter to varchar before comparing to null.
-
isDisplaySizeTwiceThePrecision
boolean isDisplaySizeTwiceThePrecision()- Returns:
- Handles the special case of DB2 where the display size returned is twice the precision. In that case, the length is the precision.
-
supportsPreparedStatementMetadataRetrieval
boolean supportsPreparedStatementMetadataRetrieval()Most databases allow you to retrieve result metadata by preparing a SELECT statement.- Returns:
- true if the database supports retrieval of query metadata from a prepared statement. False if the query needs to be executed first.
-
isSystemTable
- Parameters:
tableName
-- Returns:
- true if the specified table is a system table
-
supportsNewLinesInSQL
boolean supportsNewLinesInSQL()- Returns:
- true if the database supports newlines in a SQL statements.
-
getSQLListOfSchemas
String getSQLListOfSchemas()- Returns:
- the SQL to retrieve the list of schemas
-
getSQLListOfSchemas
- Parameters:
dbMeta
-- Returns:
- the SQL to retrieve the list of schemas
-
getMaxColumnsInIndex
int getMaxColumnsInIndex()- Returns:
- The maximum number of columns in a database, <=0 means: no known limit
-
supportsErrorHandlingOnBatchUpdates
boolean supportsErrorHandlingOnBatchUpdates()- Returns:
- true if the database supports error handling (recovery of failure) while doing batch updates.
-
getSQLInsertAutoIncUnknownDimensionRow
String getSQLInsertAutoIncUnknownDimensionRow(String schemaTable, String keyField, String versionField) Get the SQL to insert a new empty unknown record in a dimension.- 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.
-
isExplorable
boolean isExplorable()- Returns:
- true if this is a relational database you can explore. Return false for SAP, PALO, etc.
-
getXulOverlayFile
String getXulOverlayFile()- Returns:
- The name of the XUL overlay file to display extra options. This is only used in case of a non-standard plugin. Usually this method returns null.
-
getSQLListOfSequences
String getSQLListOfSequences()- Returns:
- The SQL on this database to get a list of sequences.
-
quoteSQLString
Adds quotes around the string according to the database dialect and also escapes special characters like CR, LF and the quote character itself.- Parameters:
string
-- Returns:
- A string that is properly quoted for use in a SQL statement (insert, update, delete, etc)
-
getSelectCountStatement
Returns the SQL Statement that counts the number of rows in the table.- Parameters:
tableName
-- Returns:
-
generateColumnAlias
Generate a column alias given the column index and suggested name.- Parameters:
columnIndex
- Index of column in querysuggestedName
- Suggested column name- Returns:
- Column alias that is valid for this database
-
parseStatements
Parse all possible statements from the provided SQL script.- Parameters:
sqlScript
- Raw SQL Script to be parsed into executable statements.- Returns:
- List of parsed SQL statements to be executed separately.
-
getSqlScriptStatements
Parse the statements in the provided SQL script, provide more information about where each was found in the script.- Parameters:
sqlScript
- Raw SQL Script to be parsed into executable statements.- Returns:
- List of SQL script statements to be executed separately.
-
isMySQLVariant
boolean isMySQLVariant()- Returns:
- true if the database is a MySQL variant, like MySQL 5.1, InfiniDB, InfoBright, and so on.
-
releaseSavepoint
boolean releaseSavepoint()Returns a true of savepoints can be release, false if not.- Returns:
-
getNextBatchId
Long getNextBatchId(DatabaseMeta dbm, Database ldb, String schemaName, String tableName, String fieldName) throws KettleDatabaseException Get the next Batch ID from the logging tables.- Parameters:
dbm
- DatabaseMeta objectldb
- Database connectionschemaName
- Logging Schema NametableName
- Logging Table NamefieldName
- Batch Id Field name- Returns:
- next batch ID
- Throws:
KettleDatabaseException
-
getDataTablespaceDDL
Returns the tablespace DDL fragment for a "Data" tablespace. In most databases that use tablespaces this is where the tables are to be created.- Parameters:
variables
- variables used for possible substitutiondatabaseMeta
- databaseMeta the database meta used for possible string enclosure of the tablespace. This method needs this as this is done after environmental substitution.- Returns:
- String the tablespace name for tables in the format "tablespace TABLESPACE_NAME". The TABLESPACE_NAME and the passed DatabaseMata determines if TABLESPACE_NAME is to be enclosed in quotes.
-
getIndexTablespaceDDL
Returns the tablespace DDL fragment for a "Index" tablespace.- Parameters:
variables
- variables used for possible substitutiondatabaseMeta
- databaseMeta the database meta used for possible string enclosure of the tablespace. This method needs this as this is done after environmental substitution.- Returns:
- String the tablespace name for indicis in the format "tablespace TABLESPACE_NAME". The TABLESPACE_NAME and the passed DatabaseMata determines if TABLESPACE_NAME is to be enclosed in quotes.
-
getValueFromResultSet
Object getValueFromResultSet(ResultSet resultSet, ValueMetaInterface valueMeta, int index) throws KettleDatabaseException This method allows a database dialect to convert database specific data types to Kettle data types.- Parameters:
resultSet
- The result set to usevalueMeta
- The description of the value to retrieveindex
- the index on which we need to retrieve the value, 0-based.- Returns:
- The correctly converted Kettle data type corresponding to the valueMeta description.
- Throws:
KettleDatabaseException
-
useSafePoints
boolean useSafePoints()- Returns:
- true if the database supports the use of safe-points and if it is appropriate to ever use it (default to false)
-
supportsErrorHandling
boolean supportsErrorHandling()- Returns:
- true if the database supports error handling (the default). Returns false for certain databases (SQLite) that invalidate a prepared statement or even the complete connection when an error occurs.
-
getSQLValue
String getSQLValue(ValueMetaInterface valueMeta, Object valueData, String dateFormat) throws KettleValueException Convert a value in the SQL equivalent. For example, convert String "Pentaho" into 'Pentaho' or into Oracle date format TO_DATE('2012/08/16 15:36:59', 'YYYY/MM/DD HH24:MI:SS')- Parameters:
valueMeta
- The description of the value. The date format used is taken from this value unless dateFormat is specified (not null or empty)valueData
- The data to convert.- Returns:
- The value SQL clause
- Throws:
KettleValueException
- in case there is a data conversion error.
-
supportsResultSetMetadataRetrievalOnly
boolean supportsResultSetMetadataRetrievalOnly()- Returns:
- true if this database only supports metadata retrieval on a result set, never on a statement (even if the statement has been executed)
-
supportsTimestampDataType
boolean supportsTimestampDataType()- Returns:
- true if the database supports the Timestamp data type (nanosecond precision and all)
-
setSupportsTimestampDataType
void setSupportsTimestampDataType(boolean b) - Parameters:
b
- Set to true if the database supports the Timestamp data type (nanosecond precision and all)
-
getSafeFieldname
Given a String, this will sanitize and return a value safe for usage as a column name- Parameters:
fieldName
- value to sanitize- Returns:
- a String safe for usage as a column name without the need for quoting
-
getSequenceNoMaxValueOption
String getSequenceNoMaxValueOption()- Returns:
- true if the database supports sequences with a maximum value option. The default is true.
-
supportsAutoGeneratedKeys
boolean supportsAutoGeneratedKeys()- Returns:
- true if the database supports autoGeneratedKeys
-
customizeValueFromSQLType
ValueMetaInterface customizeValueFromSQLType(ValueMetaInterface v, ResultSetMetaData rm, int index) throws SQLException Customizes the ValueMetaInterface defined in the base- Parameters:
v
- the determined valueMetaInterfacerm
- the sql column typeindex
- the index to the column to customize- Returns:
- ValueMetaInterface customized with the data base specific types
- Throws:
SQLException
-
getCreateTableStatement
String getCreateTableStatement()Customizes the ValueMetaInterface defined in the base- Returns:
- String the create table statement
-
addDefaultOptions
Deprecated.No longer works with the UI, Use getDefaultOptions, insteadSet default options for this database -
createSqlScriptParser
Create SqlScriptParser for current database dialect- Returns:
- instance of SqlScriptParser for current database dialect
-
supportsStandardTableOutput
default boolean supportsStandardTableOutput()- Returns:
- true if database supports the standard table output step
-
getUnsupportedTableOutputMessage
- Returns:
- the unsupported message if database does not support standard table output step
-
getLegacyColumnName
default String getLegacyColumnName(DatabaseMetaData dbMetaData, ResultSetMetaData rsMetaData, int index) throws KettleDatabaseException Allows to get the column name for JDBC drivers with different behavior for aliases depending on the connector version.- Parameters:
dbMetaData
-rsMetaData
-index
-- Returns:
- empty if the database doesn't support the legacy column name feature
- Throws:
KettleDatabaseException
-
putOptionalOptions
-
getSchemas
default ResultSet getSchemas(DatabaseMetaData databaseMetaData, DatabaseMeta dbMeta) throws SQLException - Throws:
SQLException
-
getTables
default ResultSet getTables(DatabaseMetaData databaseMetaData, DatabaseMeta dbMeta, String schemaPattern, String tableNamePattern, String[] tableTypes) throws SQLException - Throws:
SQLException
-
getNamedCluster
- Returns:
- The hadoop cluster associated with the connection
-
setNamedCluster
Set the hadoop cluster associated with the connection- Parameters:
namedCluster
- The hadoop cluster name
-
getNamedClusterList
-