Class DatabaseMeta

    • Field Detail

      • TYPE_DATABASE_NONE

        @Deprecated
        public static final int TYPE_DATABASE_NONE
        Deprecated.
        Indicates that the connections doesn't point to a type of database yet.
        See Also:
        Constant Field Values
      • TYPE_DATABASE_AS400

        @Deprecated
        public static final int TYPE_DATABASE_AS400
        Deprecated.
        Connection to an AS/400 (IBM iSeries) DB400 database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_ACCESS

        @Deprecated
        public static final int TYPE_DATABASE_ACCESS
        Deprecated.
        Connection to an Microsoft Access database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_MSSQL

        @Deprecated
        public static final int TYPE_DATABASE_MSSQL
        Deprecated.
        Connection to a Microsoft SQL Server database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_POSTGRES

        @Deprecated
        public static final int TYPE_DATABASE_POSTGRES
        Deprecated.
        Connection to a PostgreSQL database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_CACHE

        @Deprecated
        public static final int TYPE_DATABASE_CACHE
        Deprecated.
        Connection to an Intersystems Cache database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_INFORMIX

        @Deprecated
        public static final int TYPE_DATABASE_INFORMIX
        Deprecated.
        Connection to an IBM Informix database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_SYBASE

        @Deprecated
        public static final int TYPE_DATABASE_SYBASE
        Deprecated.
        Connection to a Sybase ASE database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_GUPTA

        @Deprecated
        public static final int TYPE_DATABASE_GUPTA
        Deprecated.
        Connection to a Gupta SQLBase database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_DBASE

        @Deprecated
        public static final int TYPE_DATABASE_DBASE
        Deprecated.
        Connection to a DBase III/IV/V database through JDBC
        See Also:
        Constant Field Values
      • TYPE_DATABASE_FIREBIRD

        @Deprecated
        public static final int TYPE_DATABASE_FIREBIRD
        Deprecated.
        Connection to a FireBird database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_HYPERSONIC

        @Deprecated
        public static final int TYPE_DATABASE_HYPERSONIC
        Deprecated.
        Connection to a Hypersonic java database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_INTERBASE

        @Deprecated
        public static final int TYPE_DATABASE_INTERBASE
        Deprecated.
        Connection to a Borland Interbase database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_EXTENDB

        @Deprecated
        public static final int TYPE_DATABASE_EXTENDB
        Deprecated.
        Connection to an ExtenDB database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_TERADATA

        @Deprecated
        public static final int TYPE_DATABASE_TERADATA
        Deprecated.
        Connection to a Teradata database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_ORACLE_RDB

        @Deprecated
        public static final int TYPE_DATABASE_ORACLE_RDB
        Deprecated.
        Connection to an Oracle RDB database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_UNIVERSE

        @Deprecated
        public static final int TYPE_DATABASE_UNIVERSE
        Deprecated.
        Connection to an IBM UniVerse database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_DERBY

        @Deprecated
        public static final int TYPE_DATABASE_DERBY
        Deprecated.
        Connection to an Apache Derby database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_REMEDY_AR_SYSTEM

        @Deprecated
        public static final int TYPE_DATABASE_REMEDY_AR_SYSTEM
        Deprecated.
        Connection to a BMC Remedy Action Request System
        See Also:
        Constant Field Values
      • TYPE_DATABASE_SYBASEIQ

        @Deprecated
        public static final int TYPE_DATABASE_SYBASEIQ
        Deprecated.
        Connection to a SybaseIQ ASE database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_GREENPLUM

        @Deprecated
        public static final int TYPE_DATABASE_GREENPLUM
        Deprecated.
        Connection to a Greenplum database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_KINGBASEES

        @Deprecated
        public static final int TYPE_DATABASE_KINGBASEES
        Deprecated.
        Connection to a KingbaseES database
        See Also:
        Constant Field Values
      • TYPE_DATABASE_INFOBRIGHT

        @Deprecated
        public static final int TYPE_DATABASE_INFOBRIGHT
        Deprecated.
        Connection to an Infobright database
        See Also:
        Constant Field Values
      • TYPE_ACCESS_NATIVE

        public static final int TYPE_ACCESS_NATIVE
        Connect natively through JDBC thin driver to the database.
        See Also:
        Constant Field Values
      • TYPE_ACCESS_ODBC

        public static final int TYPE_ACCESS_ODBC
        Connect to the database using ODBC.
        See Also:
        Constant Field Values
      • TYPE_ACCESS_OCI

        public static final int TYPE_ACCESS_OCI
        Connect to the database using OCI. (Oracle only)
        See Also:
        Constant Field Values
      • TYPE_ACCESS_PLUGIN

        public static final int TYPE_ACCESS_PLUGIN
        Connect to the database using plugin specific method. (SAP ERP)
        See Also:
        Constant Field Values
      • TYPE_ACCESS_JNDI

        public static final int TYPE_ACCESS_JNDI
        Connect to the database using JNDI.
        See Also:
        Constant Field Values
      • dbAccessTypeCode

        public static final String[] dbAccessTypeCode
        Short description of the access type, used in XML and the repository.
      • dbAccessTypeDesc

        public static final String[] dbAccessTypeDesc
        Longer description for user interactions.
      • CLOB_LENGTH

        public static final int CLOB_LENGTH
        Use this length in a String value to indicate that you want to use a CLOB in stead of a normal text field.
        See Also:
        Constant Field Values
      • EMPTY_OPTIONS_STRING

        public static final String EMPTY_OPTIONS_STRING
        The value to store in the attributes so that an empty value doesn't get lost...
        See Also:
        Constant Field Values
    • Constructor Detail

      • DatabaseMeta

        public DatabaseMeta​(String name,
                            String type,
                            String access,
                            String host,
                            String db,
                            String port,
                            String user,
                            String pass)
        Construct a new database connections. Note that not all these parameters are not always mandatory.
        Parameters:
        name - The database name
        type - The type of database
        access - The type of database access
        host - The hostname or IP address
        db - The database name
        port - The port on which the database listens.
        user - The username
        pass - The password
      • DatabaseMeta

        public DatabaseMeta()
        Create an empty database connection
      • DatabaseMeta

        public DatabaseMeta​(String xml)
                     throws KettleXMLException
        Constructs a new database using an XML string snippet. It expects the snippet to be enclosed in connection tags.
        Parameters:
        xml - The XML string to parse
        Throws:
        KettleXMLException - in case there is an XML parsing error
      • DatabaseMeta

        public DatabaseMeta​(Node con)
                     throws KettleXMLException
        Reads the information from an XML Node into this new database connection.
        Parameters:
        con - The Node to read the data from
        Throws:
        KettleXMLException
    • Method Detail

      • init

        public static void init()
      • setDefault

        public void setDefault()
        Set default values for an Oracle database.
      • addOptions

        public void addOptions()
        Add a list of common options for some databases.
      • getDatabaseInterface

        public DatabaseInterface getDatabaseInterface()
        Returns:
        the system dependend database interface for this database metadata definition
      • setDatabaseInterface

        public void setDatabaseInterface​(DatabaseInterface databaseInterface)
        Set the system dependend database interface for this database metadata definition
        Parameters:
        databaseInterface - the system dependend database interface
      • getDatabaseInterface

        public static final DatabaseInterface getDatabaseInterface​(String databaseType)
                                                            throws KettleDatabaseException
        Search for the right type of DatabaseInterface object and clone it.
        Parameters:
        databaseType - the type of DatabaseInterface to look for (description)
        Returns:
        The requested DatabaseInterface
        Throws:
        KettleDatabaseException - when the type could not be found or referenced.
      • deepClone

        public Object deepClone​(boolean cloneUpdateFlag)
      • replaceMeta

        public void replaceMeta​(DatabaseMeta databaseMeta,
                                boolean cloneUpdateFlag)
      • replaceMeta

        public void replaceMeta​(DatabaseMeta databaseMeta)
      • setDatabaseType

        public void setDatabaseType​(String type)
      • setName

        public void setName​(String name)
        Sets the name of the database connection. This name should be unique in a transformation and in general in a single repository.
        Specified by:
        setName in interface RepositoryElementInterface
        Parameters:
        name - The name of the database connection
      • setDisplayName

        public void setDisplayName​(String displayName)
      • getDisplayName

        public String getDisplayName()
        Returns the name of the database connection
        Returns:
        The name of the database connection
      • getPluginId

        public String getPluginId()
        The plugin ID of the database interface
      • getAccessType

        public int getAccessType()
        Return the type of database access. One of

        TYPE_ACCESS_NATIVE

        TYPE_ACCESS_ODBC

        TYPE_ACCESS_OCI

        Returns:
        The type of database access.
      • setAccessType

        public void setAccessType​(int access_type)
        Set the type of database access.
        Parameters:
        access_type - The access type.
      • getDatabaseTypeDesc

        @Deprecated
        public String getDatabaseTypeDesc()
        Deprecated.
        This is actually the plugin ID
        Returns a short description of the type of database.
        Returns:
        A short description of the type of database.
      • getAccessTypeDesc

        public String getAccessTypeDesc()
        Gets you a short description of the type of database access.
        Returns:
        A short description of the type of database access.
      • getHostname

        public String getHostname()
        Return the hostname of the machine on which the database runs.
        Returns:
        The hostname of the database.
      • setHostname

        public void setHostname​(String hostname)
        Sets the hostname of the machine on which the database runs.
        Parameters:
        hostname - The hostname of the machine on which the database runs.
      • getDatabasePortNumberString

        public String getDatabasePortNumberString()
        Return the port on which the database listens as a String. Allows for parameterisation.
        Returns:
        The database port.
      • setDBPort

        public void setDBPort​(String db_port)
        Sets the port on which the database listens.
        Parameters:
        db_port - The port number on which the database listens
      • getDatabaseName

        public String getDatabaseName()
        Return the name of the database.
        Returns:
        The database name.
      • setDBName

        public void setDBName​(String databaseName)
        Set the name of the database.
        Parameters:
        databaseName - The new name of the database
      • getUsername

        public String getUsername()
        Get the username to log into the database on this connection.
        Returns:
        The username to log into the database on this connection.
      • setUsername

        public void setUsername​(String username)
        Sets the username to log into the database on this connection.
        Parameters:
        username - The username
      • getPassword

        public String getPassword()
        Get the password to log into the database on this connection.
        Returns:
        the password to log into the database on this connection.
      • setPassword

        public void setPassword​(String password)
        Sets the password to log into the database on this connection.
        Parameters:
        password - the password to log into the database on this connection.
      • setServername

        public void setServername​(String servername)
        Parameters:
        servername - the Informix servername
      • getServername

        public String getServername()
        Returns:
        the Informix servername
      • getDataTablespace

        public String getDataTablespace()
      • setDataTablespace

        public void setDataTablespace​(String data_tablespace)
      • getIndexTablespace

        public String getIndexTablespace()
      • setIndexTablespace

        public void setIndexTablespace​(String index_tablespace)
      • isNeedUpdate

        public boolean isNeedUpdate()
      • setNeedUpdate

        public void setNeedUpdate​(boolean needUpdate)
      • setChanged

        public void setChanged()
      • setChanged

        public void setChanged​(boolean ch)
      • hasChanged

        public boolean hasChanged()
      • clearChanged

        public void clearChanged()
      • getAttributes

        public Properties getAttributes()
        Returns:
        The extra attributes for this database connection
      • setAttributes

        public void setAttributes​(Properties attributes)
        Set extra attributes on this database connection
        Parameters:
        attributes - The extra attributes to set on this database connection.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • databaseForBothDbInterfacesIsTheSame

        protected boolean databaseForBothDbInterfacesIsTheSame​(DatabaseInterface primary,
                                                               DatabaseInterface secondary)
        This method is designed to identify whether the actual database for two database connection types is the same. This situation can occur in two cases: 1. plugin id of primary is the same as plugin id of secondary 2. secondary is a descendant primary (with any deepness).
      • getConnectionProperties

        public Properties getConnectionProperties()
      • getExtraOptionIndicator

        public String getExtraOptionIndicator()
      • getExtraOptionSeparator

        public String getExtraOptionSeparator()
        Returns:
        The extra option separator in database URL for this platform (usually this is semicolon ; )
      • getExtraOptionValueSeparator

        public String getExtraOptionValueSeparator()
        Returns:
        The extra option value separator in database URL for this platform (usually this is the equal sign = )
      • addExtraOption

        public void addExtraOption​(String databaseTypeCode,
                                   String option,
                                   String value)
        Add an extra option to the attributes list
        Parameters:
        databaseTypeCode - The database type code for which the option applies
        option - The option to set
        value - The value of the option
      • applyDefaultOptions

        public void applyDefaultOptions​(DatabaseInterface databaseInterface)
      • supportsTransactions

        @Deprecated
        public boolean supportsTransactions()
        Deprecated.
        because the same database can support transactions or not. It all depends on the database setup. Therefor, we look at the database metadata DatabaseMetaData.supportsTransactions() in stead of this.
        Returns:
        true if the database supports transactions
      • supportsAutoinc

        public boolean supportsAutoinc()
      • supportsSequences

        public boolean supportsSequences()
      • getSQLSequenceExists

        public String getSQLSequenceExists​(String sequenceName)
      • supportsBitmapIndex

        public boolean supportsBitmapIndex()
      • supportsSetLong

        public boolean supportsSetLong()
      • supportsSchemas

        public boolean supportsSchemas()
        Returns:
        true if the database supports schemas
      • supportsCatalogs

        public boolean supportsCatalogs()
        Returns:
        true if the database supports catalogs
      • supportsEmptyTransactions

        public boolean supportsEmptyTransactions()
        Returns:
        true when the database engine supports empty transaction. (for example Informix does not on a non-ANSI database type!)
      • supportsSetCharacterStream

        public 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.
      • getMaxTextFieldLength

        public 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)
      • getAccessType

        public static final int getAccessType​(String dbaccess)
      • getAccessTypeDesc

        public static final String getAccessTypeDesc​(int dbaccess)
      • getAccessTypeDescLong

        public static final String getAccessTypeDescLong​(int dbaccess)
      • getDatabaseInterfaces

        public static final DatabaseInterface[] getDatabaseInterfaces()
      • clearDatabaseInterfacesMap

        public static final void clearDatabaseInterfacesMap()
        Clear the database interfaces map. The map is cached by getDatabaseInterfacesMap(), but in some instances it may need to be reloaded (such as adding/updating Database plugins). After calling clearDatabaseInterfacesMap(), the next call to getDatabaseInterfacesMap() will reload the map.
      • getAccessTypeList

        public static final int[] getAccessTypeList​(String dbTypeDesc)
      • getPortForDBType

        public static final int getPortForDBType​(String strtype,
                                                 String straccess)
      • getDefaultDatabasePort

        public int getDefaultDatabasePort()
      • getNotFoundTK

        public int getNotFoundTK​(boolean use_autoinc)
      • getDriverClass

        public String getDriverClass()
      • getSeqNextvalSQL

        public String getSeqNextvalSQL​(String sequenceName)
      • getSQLCurrentSequenceValue

        public String getSQLCurrentSequenceValue​(String sequenceName)
      • isFetchSizeSupported

        public boolean isFetchSizeSupported()
      • needsPlaceHolder

        public 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

        public String getFunctionSum()
      • getFunctionAverage

        public String getFunctionAverage()
      • getFunctionMaximum

        public String getFunctionMaximum()
      • getFunctionMinimum

        public String getFunctionMinimum()
      • getFunctionCount

        public String getFunctionCount()
      • checkParameters

        public String[] checkParameters()
        Check the database connection parameters and give back an array of remarks
        Returns:
        an array of remarks Strings
      • getSchemaTableCombination

        @Deprecated
        public String getSchemaTableCombination​(String schemaName,
                                                String tableName)
        Deprecated.
        please use getQuotedSchemaTableCombination()
        This is now replaced with getQuotedSchemaTableCombination(), enforcing the use of the quoteFields call
        Parameters:
        schemaName -
        tableName -
        Returns:
      • getQuotedSchemaTableCombination

        public String getQuotedSchemaTableCombination​(String schemaName,
                                                      String tableName)
        Calculate the schema-table combination, usually this is the schema and table separated with a dot. (schema.table)
        Parameters:
        schemaName - the schema-name or null if no schema is used.
        tableName - the table name
        Returns:
        the schemaname-tablename combination
      • getLimitClause

        public String getLimitClause​(int nrRows)
      • getSQLQueryFields

        public String getSQLQueryFields​(String tableName)
        Parameters:
        tableName - The table or schema-table combination. We expect this to be quoted properly already!
        Returns:
        the SQL for to get the fields of this table.
      • getReservedWords

        public String[] getReservedWords()
        Returns:
        an array of reserved words for the database type...
      • quoteReservedWords

        public boolean quoteReservedWords()
        Returns:
        true if reserved words need to be double quoted ("password", "select", ...)
      • getStartQuote

        public String getStartQuote()
        Returns:
        The start quote sequence, mostly just double quote, but sometimes [, ...
      • getEndQuote

        public String getEndQuote()
        Returns:
        The end quote sequence, mostly just double quote, but sometimes ], ...
      • quoteField

        public String quoteField​(String field)
        Returns a quoted field if this is needed: contains spaces, is a reserved word, ...
        Parameters:
        field - The fieldname to check for quoting
        Returns:
        The quoted field (if this is needed.
      • isInNeedOfQuoting

        public boolean isInNeedOfQuoting​(String fieldname)
        Determines whether or not this field is in need of quoting:
        - When the fieldname contains spaces
        - When the fieldname is a reserved word
        Parameters:
        fieldname - the fieldname to check if there is a need for quoting
        Returns:
        true if the fieldname needs to be quoted.
      • isReservedWord

        public boolean isReservedWord​(String word)
        Returns true if the string specified is a reserved word on this database type.
        Parameters:
        word - The word to check
        Returns:
        true if word is a reserved word on this database.
      • hasSpacesInField

        public boolean hasSpacesInField​(String fieldname)
        Detects if a field has spaces in the name. We need to quote the field in that case.
        Parameters:
        fieldname - The fieldname to check for spaces
        Returns:
        true if the fieldname contains spaces
      • hasSpecialCharInField

        public boolean hasSpecialCharInField​(String fieldname)
        Detects if a field has spaces in the name. We need to quote the field in that case.
        Parameters:
        fieldname - The fieldname to check for spaces
        Returns:
        true if the fieldname contains spaces
      • hasDotInField

        public boolean hasDotInField​(String fieldname)
      • replaceReservedWords

        public boolean replaceReservedWords​(RowMetaInterface fields)
        Checks the fields specified for reserved words and quotes them.
        Parameters:
        fields - the list of fields to check
        Returns:
        true if one or more values have a name that is a reserved word on this database type.
      • getNrReservedWords

        public int getNrReservedWords​(RowMetaInterface fields)
        Checks the fields specified for reserved words
        Parameters:
        fields - the list of fields to check
        Returns:
        The nr of reserved words for this database.
      • getTableTypes

        public String[] getTableTypes()
        Returns:
        a list of types to get the available tables
      • getViewTypes

        public String[] getViewTypes()
        Returns:
        a list of types to get the available views
      • getSynonymTypes

        public String[] getSynonymTypes()
        Returns:
        a list of types to get the available synonyms
      • useSchemaNameForTableList

        public boolean useSchemaNameForTableList()
        Returns:
        true if we need to supply the schema-name to getTables in order to get a correct list of items.
      • supportsViews

        public boolean supportsViews()
        Returns:
        true if the database supports views
      • supportsSynonyms

        public boolean supportsSynonyms()
        Returns:
        true if the database supports synonyms
      • getSQLListOfProcedures

        public String getSQLListOfProcedures()
        Returns:
        The SQL on this database to get a list of stored procedures.
      • getTruncateTableStatement

        public String getTruncateTableStatement​(String schema,
                                                String tableName)
        Parameters:
        tableName - The tablename to be truncated
        Returns:
        The SQL statement to remove all rows from the specified statement, if possible without using transactions
      • supportsFloatRoundingOnUpdate

        public 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

        public String getSQLLockTables​(String[] tableNames)
        Parameters:
        tableNames - The names of the tables to lock
        Returns:
        The SQL commands to lock database tables for write purposes. null is returned in case locking is not supported on the target database.
      • getSQLUnlockTables

        public String getSQLUnlockTables​(String[] tableNames)
        Parameters:
        tableNames - The names of the tables to unlock
        Returns:
        The SQL commands to unlock databases tables. null is returned in case locking is not supported on the target database.
      • getFeatureSummary

        public List<RowMetaAndData> getFeatureSummary()
        Returns:
        a feature list for the chosen database type.
      • supportsTimeStampToDateConversion

        public boolean supportsTimeStampToDateConversion()
        Returns:
        true if the database result sets support getTimeStamp() to retrieve date-time. (Date)
      • supportsBatchUpdates

        public boolean supportsBatchUpdates()
        Returns:
        true if the database JDBC driver supports batch updates For example Interbase doesn't support this!
      • supportsBooleanDataType

        public boolean supportsBooleanDataType()
        Returns:
        true if the database supports a boolean, bit, logical, ... datatype
      • setSupportsBooleanDataType

        public void setSupportsBooleanDataType​(boolean b)
        Parameters:
        b - Set to true if the database supports a boolean, bit, logical, ... datatype
      • supportsTimestampDataType

        public boolean supportsTimestampDataType()
        Returns:
        true if the database supports the Timestamp data type (nanosecond precision and all)
      • setSupportsTimestampDataType

        public void setSupportsTimestampDataType​(boolean b)
        Parameters:
        b - Set to true if the database supports the Timestamp data type (nanosecond precision and all)
      • preserveReservedCase

        public boolean preserveReservedCase()
        Returns:
        true if reserved words' case should be preserved
      • setPreserveReservedCase

        public void setPreserveReservedCase​(boolean b)
      • quoteReservedWords

        public void quoteReservedWords​(RowMetaInterface fields)
        Changes the names of the fields to their quoted equivalent if this is needed
        Parameters:
        fields - The row of fields to change
      • getExtraOptions

        public Map<String,​String> getExtraOptions()
        Returns:
        a map of all the extra URL options you want to set.
      • supportsOptionsInURL

        public boolean supportsOptionsInURL()
        Returns:
        true if the database supports connection options in the URL, false if they are put in a Properties object.
      • getExtraOptionsHelpText

        public String getExtraOptionsHelpText()
        Returns:
        extra help text on the supported options on the selected database platform.
      • supportsGetBlob

        public 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

        public String getConnectSQL()
        Returns:
        The SQL to execute right after connecting
      • setConnectSQL

        public void setConnectSQL​(String sql)
        Parameters:
        sql - The SQL to execute right after connecting
      • supportsSetMaxRows

        public boolean supportsSetMaxRows()
        Returns:
        true if the database supports setting the maximum number of return rows in a resultset.
      • verifyAndModifyDatabaseName

        public String verifyAndModifyDatabaseName​(List<DatabaseMeta> databases,
                                                  String oldname)
        Verify the name of the database and if required, change it if it already exists in the list of databases.
        Parameters:
        databases - the databases to check against.
        oldname - the old name of the database
        Returns:
        the new name of the database connection
      • isUsingConnectionPool

        public boolean isUsingConnectionPool()
        Returns:
        true if we want to use a database connection pool
      • setUsingConnectionPool

        public void setUsingConnectionPool​(boolean usePool)
        Parameters:
        usePool - true if we want to use a database connection pool
      • getMaximumPoolSize

        public int getMaximumPoolSize()
        Returns:
        the maximum pool size
      • getMaximumPoolSizeString

        public String getMaximumPoolSizeString()
        Returns:
        the maximum pool size variable name
      • setMaximumPoolSize

        public void setMaximumPoolSize​(int maximumPoolSize)
        Parameters:
        maximumPoolSize - the maximum pool size
      • setMaximumPoolSizeString

        public void setMaximumPoolSizeString​(String maximumPoolSize)
        Parameters:
        maximumPoolSize - the maximum pool size variable name
      • getInitialPoolSize

        public int getInitialPoolSize()
        Returns:
        the initial pool size
      • getInitialPoolSizeString

        public String getInitialPoolSizeString()
        Returns:
        the initial pool size variable name
      • setInitialPoolSize

        public void setInitialPoolSize​(int initalPoolSize)
        Parameters:
        initalPoolSize - the initial pool size
      • setInitialPoolSizeString

        public void setInitialPoolSizeString​(String initalPoolSize)
        Parameters:
        initalPoolSize - the initial pool size variable name
      • isPartitioned

        public boolean isPartitioned()
        Returns:
        true if the connection contains partitioning information
      • setPartitioned

        public void setPartitioned​(boolean partitioned)
        Parameters:
        partitioned - true if the connection is set to contain partitioning information
      • getPartitioningInformation

        public PartitionDatabaseMeta[] getPartitioningInformation()
        Returns:
        the available partition/host/databases/port combinations in the cluster
      • setPartitioningInformation

        public void setPartitioningInformation​(PartitionDatabaseMeta[] partitionInfo)
        Parameters:
        partitionInfo - the available partition/host/databases/port combinations in the cluster
      • getPartitionMeta

        public PartitionDatabaseMeta getPartitionMeta​(String partitionId)
        Finds the partition metadata for the given partition iD
        Parameters:
        partitionId - The partition ID to look for
        Returns:
        the partition database metadata or null if nothing was found.
      • getConnectionPoolingProperties

        public Properties getConnectionPoolingProperties()
      • setConnectionPoolingProperties

        public void setConnectionPoolingProperties​(Properties properties)
      • getSQLTableExists

        public String getSQLTableExists​(String tablename)
      • getSQLColumnExists

        public String getSQLColumnExists​(String columnname,
                                         String tablename)
      • needsToLockAllTables

        public boolean needsToLockAllTables()
      • isStreamingResults

        public boolean isStreamingResults()
        Returns:
        true if the database is streaming results (normally this is an option just for MySQL).
      • setStreamingResults

        public void setStreamingResults​(boolean useStreaming)
        Parameters:
        useStreaming - true if we want the database to stream results (normally this is an option just for MySQL).
      • isQuoteAllFields

        public boolean isQuoteAllFields()
        Returns:
        true if all fields should always be quoted in db
      • setQuoteAllFields

        public void setQuoteAllFields​(boolean quoteAllFields)
        Parameters:
        quoteAllFields - true if all fields in DB should be quoted.
      • isForcingIdentifiersToLowerCase

        public boolean isForcingIdentifiersToLowerCase()
        Returns:
        true if all identifiers should be forced to lower case
      • setForcingIdentifiersToLowerCase

        public void setForcingIdentifiersToLowerCase​(boolean forceLowerCase)
        Parameters:
        forceLowerCase - true if all identifiers should be forced to lower case
      • isForcingIdentifiersToUpperCase

        public boolean isForcingIdentifiersToUpperCase()
        Returns:
        true if all identifiers should be forced to upper case
      • setForcingIdentifiersToUpperCase

        public void setForcingIdentifiersToUpperCase​(boolean forceUpperCase)
        Parameters:
        forceUpperCase - true if all identifiers should be forced to upper case
      • findDatabase

        public static final DatabaseMeta findDatabase​(List<? extends SharedObjectInterface> databases,
                                                      String dbname)
        Find a database with a certain name in an arraylist of databases.
        Parameters:
        databases - The ArrayList of databases
        dbname - The name of the database connection
        Returns:
        The database object if one was found, null otherwise.
      • indexOfName

        public static int indexOfName​(String[] databaseNames,
                                      String name)
      • findDatabase

        public static final DatabaseMeta findDatabase​(List<DatabaseMeta> databases,
                                                      ObjectId id)
        Find a database with a certain ID in an arraylist of databases.
        Parameters:
        databases - The ArrayList of databases
        id - The id of the database connection
        Returns:
        The database object if one was found, null otherwise.
      • copyVariablesFrom

        public void copyVariablesFrom​(VariableSpace space)
        Description copied from interface: VariableSpace
        Copy the variables from another space, without initializing with the defaults. This does not affect any parent relationship.
        Specified by:
        copyVariablesFrom in interface VariableSpace
        Parameters:
        space - the space to copy the variables from.
      • environmentSubstitute

        public String environmentSubstitute​(String aString)
        Description copied from interface: VariableSpace
        Substitute the string using the current variable space.
        Specified by:
        environmentSubstitute in interface VariableSpace
        Parameters:
        aString - The string to substitute.
        Returns:
        The substituted string.
      • environmentSubstitute

        public String[] environmentSubstitute​(String[] aString)
        Description copied from interface: VariableSpace
        Replaces environment variables in an array of strings. See also: environmentSubstitute(String string)
        Specified by:
        environmentSubstitute in interface VariableSpace
        Parameters:
        aString - The array of strings that wants its variables to be replaced.
        Returns:
        the array with the environment variables replaced.
      • fieldSubstitute

        public String fieldSubstitute​(String aString,
                                      RowMetaInterface rowMeta,
                                      Object[] rowData)
                               throws KettleValueException
        Description copied from interface: VariableSpace
        Substitutes field values in aString. Field values are of the form "?{}". The values are retrieved from the specified row. Please note that the getString() method is used to convert to a String, for all values in the row.
        Specified by:
        fieldSubstitute in interface VariableSpace
        Parameters:
        aString - the string on which to apply the substitution.
        rowMeta - The row metadata to use.
        rowData - The row data to use
        Returns:
        the string with the substitution applied.
        Throws:
        KettleValueException - In case there is a String conversion error
      • getVariable

        public String getVariable​(String variableName,
                                  String defaultValue)
        Description copied from interface: VariableSpace
        Get the value of a variable with a default in case the variable is not found.
        Specified by:
        getVariable in interface VariableSpace
        Parameters:
        variableName - The name of the variable
        defaultValue - The default value in case the variable could not be found
        Returns:
        the String value of a variable
      • getVariable

        public String getVariable​(String variableName)
        Description copied from interface: VariableSpace
        Get the value of a variable.
        Specified by:
        getVariable in interface VariableSpace
        Parameters:
        variableName - The name of the variable
        Returns:
        the String value of a variable or null in case the variable could not be found.
      • getBooleanValueOfVariable

        public boolean getBooleanValueOfVariable​(String variableName,
                                                 boolean defaultValue)
        Description copied from interface: VariableSpace
        This method returns a boolean for the new variable check boxes. If the variable name is not set or the variable name is not specified, this method simply returns the default value. If not, it convert the variable value to a boolean. "Y", "YES" and "TRUE" all convert to true. (case insensitive)
        Specified by:
        getBooleanValueOfVariable in interface VariableSpace
        Parameters:
        variableName - The variable to look up.
        defaultValue - The default value to return.
        Returns:
        See Also:
        static method ValueMeta.convertStringToBoolean()
      • initializeVariablesFrom

        public void initializeVariablesFrom​(VariableSpace parent)
        Description copied from interface: VariableSpace
        Initialize variable space using the defaults, copy over the variables from the parent (using copyVariablesFrom()), after this the "injected" variables should be inserted (injectVariables()). The parent is set as parent variable space.
        Specified by:
        initializeVariablesFrom in interface VariableSpace
        Parameters:
        parent - the parent to start from, or null if root.
      • listVariables

        public String[] listVariables()
        Description copied from interface: VariableSpace
        List the variables (not the values) that are currently in the variable space.
        Specified by:
        listVariables in interface VariableSpace
        Returns:
        Array of String variable names.
      • setVariable

        public void setVariable​(String variableName,
                                String variableValue)
        Description copied from interface: VariableSpace
        Sets a variable in the Kettle Variables list.
        Specified by:
        setVariable in interface VariableSpace
        Parameters:
        variableName - The name of the variable to set
        variableValue - The value of the variable to set. If the variableValue is null, the variable is cleared from the list.
      • shareVariablesWith

        public void shareVariablesWith​(VariableSpace space)
        Description copied from interface: VariableSpace
        Share a variable space from another variable space. This means that the object should take over the space used as argument.
        Specified by:
        shareVariablesWith in interface VariableSpace
        Parameters:
        space - Variable space to be shared.
      • injectVariables

        public void injectVariables​(Map<String,​String> prop)
        Description copied from interface: VariableSpace
        Inject variables. The behaviour should be that the properties object will be stored and at the time the VariableSpace is initialized (or upon calling this method if the space is already initialized). After injecting the link of the properties object should be removed.
        Specified by:
        injectVariables in interface VariableSpace
        Parameters:
        prop - Properties object containing key-value pairs.
      • getSQLServerInstance

        public String getSQLServerInstance()
        Returns:
        the SQL Server instance
      • setSQLServerInstance

        public void setSQLServerInstance​(String instanceName)
        Parameters:
        instanceName - the SQL Server instance
      • isUsingDoubleDecimalAsSchemaTableSeparator

        public boolean isUsingDoubleDecimalAsSchemaTableSeparator()
        Returns:
        true if the Microsoft SQL server uses two decimals (..) to separate schema and table (default==false).
      • setUsingDoubleDecimalAsSchemaTableSeparator

        public void setUsingDoubleDecimalAsSchemaTableSeparator​(boolean useDoubleDecimalSeparator)
        Parameters:
        useDoubleDecimalSeparator - true if we want the database to stream results (normally this is an option just for MySQL).
      • isRequiringTransactionsOnQueries

        public boolean isRequiringTransactionsOnQueries()
        Returns:
        true if this database needs a transaction to perform a query (auto-commit turned off).
      • testConnection

        public String testConnection()
      • getPreferredSchemaName

        public String getPreferredSchemaName()
      • setPreferredSchemaName

        public void setPreferredSchemaName​(String preferredSchemaName)
      • supportsSequenceNoMaxValueOption

        public boolean supportsSequenceNoMaxValueOption()
      • requiresCreateTablePrimaryKeyAppend

        public boolean requiresCreateTablePrimaryKeyAppend()
      • requiresCastToVariousForIsNull

        public boolean requiresCastToVariousForIsNull()
      • isDisplaySizeTwiceThePrecision

        public boolean isDisplaySizeTwiceThePrecision()
      • supportsPreparedStatementMetadataRetrieval

        public boolean supportsPreparedStatementMetadataRetrieval()
      • isSystemTable

        public boolean isSystemTable​(String tableName)
      • getSQLListOfSchemas

        public String getSQLListOfSchemas()
      • getMaxColumnsInIndex

        public int getMaxColumnsInIndex()
      • supportsErrorHandlingOnBatchUpdates

        public boolean supportsErrorHandlingOnBatchUpdates()
      • getSQLInsertAutoIncUnknownDimensionRow

        public 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 into
        keyField - The key field
        versionField - the version field
        Returns:
        the SQL to insert the unknown record into the SCD.
      • isExplorable

        public boolean isExplorable()
        Returns:
        true if this is a relational database you can explore. Return false for SAP, PALO, etc.
      • getSQLListOfSequences

        public String getSQLListOfSequences()
        Returns:
        The SQL on this database to get a list of sequences.
      • quoteSQLString

        public String quoteSQLString​(String string)
      • isMySQLVariant

        public boolean isMySQLVariant()
      • isReadOnly

        public boolean isReadOnly()
        Marker used to determine if the DatabaseMeta should be allowed to be modified/saved. It does NOT prevent object modification.
        Returns:
      • setReadOnly

        public void setReadOnly​(boolean readOnly)
        Sets the marker used to determine if the DatabaseMeta should be allowed to be modified/saved. Setting to true does NOT prevent object modification.
      • getSequenceNoMaxValueOption

        public String getSequenceNoMaxValueOption()
      • supportsAutoGeneratedKeys

        public boolean supportsAutoGeneratedKeys()
        Returns:
        true if the database supports autoGeneratedKeys
      • getCreateTableStatement

        public String getCreateTableStatement()
        Customizes the ValueMetaInterface defined in the base
        Returns:
        String the create table statement
      • getDropTableIfExistsStatement

        public String getDropTableIfExistsStatement​(String tableName)
        Forms the drop table statement specific for a certain RDBMS.
        Parameters:
        tableName - Name of the table to drop
        Returns:
        Drop table statement specific for the current database
        See Also:
        BISERVER-13024
      • getNamedCluster

        public String getNamedCluster()
      • setNamedCluster

        public void setNamedCluster​(String namedCluster)