Class BaseDatabaseMeta

java.lang.Object
org.pentaho.di.core.database.BaseDatabaseMeta
All Implemented Interfaces:
Cloneable, DatabaseInterface, DatabaseInterfaceExtended
Direct Known Subclasses:
AS400DatabaseMeta, AthenaDatabaseMeta, CacheDatabaseMeta, DatabricksDatabaseMeta, DB2DatabaseMeta, DbaseDatabaseMeta, DerbyDatabaseMeta, Exasol4DatabaseMeta, ExtenDBDatabaseMeta, FirebirdDatabaseMeta, GenericDatabaseMeta, GoogleBigQueryDatabaseMeta, GuptaDatabaseMeta, H2DatabaseMeta, HypersonicDatabaseMeta, InformixDatabaseMeta, IngresDatabaseMeta, InterbaseDatabaseMeta, KingbaseESDatabaseMeta, LucidDBDatabaseMeta, MondrianNativeDatabaseMeta, MonetDBDatabaseMeta, MSAccessDatabaseMeta, MSSQLServerDatabaseMeta, MySQLDatabaseMeta, NeoviewDatabaseMeta, NetezzaDatabaseMeta, OracleDatabaseMeta, OracleRDBDatabaseMeta, PostgreSQLDatabaseMeta, SAPDBDatabaseMeta, SnowflakeHVDatabaseMeta, SQLiteDatabaseMeta, SybaseDatabaseMeta, SybaseIQDatabaseMeta, TeradataDatabaseMeta, UniVerseDatabaseMeta, VerticaDatabaseMeta

public abstract class BaseDatabaseMeta extends Object implements Cloneable, DatabaseInterfaceExtended
This class contains the basic information on a database connection. It is not intended to be used other than the inheriting classes such as OracleDatabaseInfo, ...
Since:
11-mrt-2005
Author:
Matt
  • Field Details

    • ATTRIBUTE_PORT_NUMBER

      public static final String ATTRIBUTE_PORT_NUMBER
      The port number of the database as string: allows for parameterization.
      See Also:
    • ATTRIBUTE_SQL_CONNECT

      public static final String ATTRIBUTE_SQL_CONNECT
      The SQL to execute at connect time (right after connecting)
      See Also:
    • ATTRIBUTE_USE_POOLING

      public static final String ATTRIBUTE_USE_POOLING
      A flag to determine if we should use connection pooling or not.
      See Also:
    • ATTRIBUTE_MAXIMUM_POOL_SIZE

      public static final String ATTRIBUTE_MAXIMUM_POOL_SIZE
      If we use connection pooling, this would contain the maximum pool size
      See Also:
    • ATTRIBUTE_INITIAL_POOL_SIZE

      public static final String ATTRIBUTE_INITIAL_POOL_SIZE
      If we use connection pooling, this would contain the initial pool size
      See Also:
    • ATTRIBUTE_PREFIX_EXTRA_OPTION

      public static final String ATTRIBUTE_PREFIX_EXTRA_OPTION
      The prefix for all the extra options attributes
      See Also:
    • ATTRIBUTE_IS_CLUSTERED

      public static final String ATTRIBUTE_IS_CLUSTERED
      A flag to determine if the connection is clustered or not.
      See Also:
    • ATTRIBUTE_CLUSTER_HOSTNAME_PREFIX

      public static final String ATTRIBUTE_CLUSTER_HOSTNAME_PREFIX
      The clustering hostname prefix
      See Also:
    • ATTRIBUTE_CLUSTER_PORT_PREFIX

      public static final String ATTRIBUTE_CLUSTER_PORT_PREFIX
      The clustering port prefix
      See Also:
    • ATTRIBUTE_CLUSTER_DBNAME_PREFIX

      public static final String ATTRIBUTE_CLUSTER_DBNAME_PREFIX
      The clustering database name prefix
      See Also:
    • ATTRIBUTE_CLUSTER_USERNAME_PREFIX

      public static final String ATTRIBUTE_CLUSTER_USERNAME_PREFIX
      The clustering database username prefix
      See Also:
    • ATTRIBUTE_CLUSTER_PASSWORD_PREFIX

      public static final String ATTRIBUTE_CLUSTER_PASSWORD_PREFIX
      The clustering database password prefix
      See Also:
    • ATTRIBUTE_POOLING_PARAMETER_PREFIX

      public static final String ATTRIBUTE_POOLING_PARAMETER_PREFIX
      The pooling parameters
      See Also:
    • ATTRIBUTE_USE_RESULT_STREAMING

      public static final String ATTRIBUTE_USE_RESULT_STREAMING
      A flag to determine if we should use result streaming on MySQL
      See Also:
    • ATTRIBUTE_MSSQL_DOUBLE_DECIMAL_SEPARATOR

      public static final String ATTRIBUTE_MSSQL_DOUBLE_DECIMAL_SEPARATOR
      A flag to determine if we should use a double decimal separator to specify schema/table combinations on MS-SQL server
      See Also:
    • ATTRIBUTE_QUOTE_ALL_FIELDS

      public static final String ATTRIBUTE_QUOTE_ALL_FIELDS
      A flag to determine if we should quote all fields
      See Also:
    • ATTRIBUTE_FORCE_IDENTIFIERS_TO_LOWERCASE

      public static final String ATTRIBUTE_FORCE_IDENTIFIERS_TO_LOWERCASE
      A flag to determine if we should force all identifiers to lower case
      See Also:
    • ATTRIBUTE_FORCE_IDENTIFIERS_TO_UPPERCASE

      public static final String ATTRIBUTE_FORCE_IDENTIFIERS_TO_UPPERCASE
      A flag to determine if we should force all identifiers to UPPER CASE
      See Also:
    • ATTRIBUTE_PREFERRED_SCHEMA_NAME

      public static final String ATTRIBUTE_PREFERRED_SCHEMA_NAME
      The preferred schema to use if no other has been specified.
      See Also:
    • ATTRIBUTE_SUPPORTS_BOOLEAN_DATA_TYPE

      public static final String ATTRIBUTE_SUPPORTS_BOOLEAN_DATA_TYPE
      Checkbox to allow you to configure if the database supports the boolean data type or not. Defaults to "false" for backward compatibility!
      See Also:
    • ATTRIBUTE_SUPPORTS_TIMESTAMP_DATA_TYPE

      public static final String ATTRIBUTE_SUPPORTS_TIMESTAMP_DATA_TYPE
      Checkbox to allow you to configure if the database supports the Timestamp data type or not. Defaults to "false" for backward compatibility!
      See Also:
    • ATTRIBUTE_PRESERVE_RESERVED_WORD_CASE

      public static final String ATTRIBUTE_PRESERVE_RESERVED_WORD_CASE
      Checkbox to allow you to configure if the reserved words will have their case changed during the handleCase call
      See Also:
    • SEQUENCE_FOR_BATCH_ID

      public static final String SEQUENCE_FOR_BATCH_ID
      See Also:
    • AUTOINCREMENT_SQL_FOR_BATCH_ID

      public static final String AUTOINCREMENT_SQL_FOR_BATCH_ID
      See Also:
    • NAMED_CLUSTER_ID

      public static final String NAMED_CLUSTER_ID
      See Also:
    • releaseSavepoint

      protected boolean releaseSavepoint
      Boolean to indicate if savepoints can be released Most databases do, so we set it to true. Child classes can overwrite with false if need be.
    • SELECT_COUNT_STATEMENT

      public static final String SELECT_COUNT_STATEMENT
      The SQL, minus the table name, to select the number of rows from a table
      See Also:
    • poolingParameters

      public static final DatabaseConnectionPoolParameter[] poolingParameters
  • Constructor Details

    • BaseDatabaseMeta

      public BaseDatabaseMeta()
  • Method Details

    • getPluginId

      public String getPluginId()
      Specified by:
      getPluginId in interface DatabaseInterface
      Returns:
      plugin ID of this class
    • setPluginId

      public void setPluginId(String pluginId)
      Specified by:
      setPluginId in interface DatabaseInterface
      Parameters:
      pluginId - The plugin ID to set.
    • getPluginName

      public String getPluginName()
      Specified by:
      getPluginName in interface DatabaseInterface
      Returns:
      plugin name of this class
    • setPluginName

      public void setPluginName(String pluginName)
      Specified by:
      setPluginName in interface DatabaseInterface
      Parameters:
      pluginName - The plugin name to set.
    • getAccessTypeList

      public abstract int[] getAccessTypeList()
      Description copied from interface: DatabaseInterface
      Get the list of possible access types for a database.
      Specified by:
      getAccessTypeList in interface DatabaseInterface
      Returns:
      the list of possible access types for a database.
    • getAccessType

      public int getAccessType()
      Specified by:
      getAccessType in interface DatabaseInterface
      Returns:
      Returns the accessType.
    • setAccessType

      public void setAccessType(int accessType)
      Specified by:
      setAccessType in interface DatabaseInterface
      Parameters:
      accessType - The accessType to set.
    • isChanged

      public boolean isChanged()
      Specified by:
      isChanged in interface DatabaseInterface
      Returns:
      Returns the changed.
    • setChanged

      public void setChanged(boolean changed)
      Specified by:
      setChanged in interface DatabaseInterface
      Parameters:
      changed - The changed to set.
    • getName

      public String getName()
      Specified by:
      getName in interface DatabaseInterface
      Returns:
      Returns the connection name.
    • setName

      public void setName(String name)
      Specified by:
      setName in interface DatabaseInterface
      Parameters:
      name - The connection Name to set.
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface DatabaseInterface
      Returns:
      Returns the un-escaped connection Name.
    • setDisplayName

      public void setDisplayName(String displayName)
      Specified by:
      setDisplayName in interface DatabaseInterface
      Parameters:
      displayName - The un-escaped connection Name to set.
    • getDatabaseName

      public String getDatabaseName()
      Specified by:
      getDatabaseName in interface DatabaseInterface
      Returns:
      Returns the databaseName.
    • setDatabaseName

      public void setDatabaseName(String databaseName)
      Specified by:
      setDatabaseName in interface DatabaseInterface
      Parameters:
      databaseName - The databaseName to set.
    • setDatabasePortNumberString

      public void setDatabasePortNumberString(String databasePortNumberString)
      Specified by:
      setDatabasePortNumberString in interface DatabaseInterface
      Parameters:
      databasePortNumberString - The databasePortNumber string to set.
    • getDatabasePortNumberString

      public String getDatabasePortNumberString()
      Specified by:
      getDatabasePortNumberString in interface DatabaseInterface
      Returns:
      Returns the databasePortNumber string.
    • getHostname

      public String getHostname()
      Specified by:
      getHostname in interface DatabaseInterface
      Returns:
      Returns the hostname.
    • setHostname

      public void setHostname(String hostname)
      Specified by:
      setHostname in interface DatabaseInterface
      Parameters:
      hostname - The hostname to set.
    • getObjectId

      public ObjectId getObjectId()
      Specified by:
      getObjectId in interface DatabaseInterface
      Returns:
      Returns the id.
    • setObjectId

      public void setObjectId(ObjectId id)
      Specified by:
      setObjectId in interface DatabaseInterface
      Parameters:
      id - The id to set.
    • getPassword

      public String getPassword()
      Specified by:
      getPassword in interface DatabaseInterface
      Returns:
      Returns the password.
    • setPassword

      public void setPassword(String password)
      Specified by:
      setPassword in interface DatabaseInterface
      Parameters:
      password - The password to set.
    • getServername

      public String getServername()
      Specified by:
      getServername in interface DatabaseInterface
      Returns:
      Returns the servername.
    • setServername

      public void setServername(String servername)
      Specified by:
      setServername in interface DatabaseInterface
      Parameters:
      servername - The servername to set.
    • getDataTablespace

      public String getDataTablespace()
      Specified by:
      getDataTablespace in interface DatabaseInterface
      Returns:
      Returns the tablespaceData.
    • setDataTablespace

      public void setDataTablespace(String dataTablespace)
      Specified by:
      setDataTablespace in interface DatabaseInterface
      Parameters:
      dataTablespace - The data tablespace to set.
    • getIndexTablespace

      public String getIndexTablespace()
      Specified by:
      getIndexTablespace in interface DatabaseInterface
      Returns:
      Returns the index tablespace.
    • setIndexTablespace

      public void setIndexTablespace(String indexTablespace)
      Specified by:
      setIndexTablespace in interface DatabaseInterface
      Parameters:
      indexTablespace - The index tablespace to set.
    • getUsername

      public String getUsername()
      Specified by:
      getUsername in interface DatabaseInterface
      Returns:
      Returns the username.
    • setUsername

      public void setUsername(String username)
      Specified by:
      setUsername in interface DatabaseInterface
      Parameters:
      username - The username to set.
    • getAttributes

      public Properties getAttributes()
      Specified by:
      getAttributes in interface DatabaseInterface
      Returns:
      The extra attributes for this database connection
    • setAttributes

      public void setAttributes(Properties attributes)
      Set extra attributes on this database connection
      Specified by:
      setAttributes in interface DatabaseInterface
      Parameters:
      attributes - The extra attributes to set on this database connection.
    • clone

      public Object clone()
      Clone the basic settings for this connection!
      Specified by:
      clone in interface DatabaseInterface
      Overrides:
      clone in class Object
      Returns:
      the cloned Database Interface object.
    • getDefaultDatabasePort

      public int getDefaultDatabasePort()
      Specified by:
      getDefaultDatabasePort in interface DatabaseInterface
      Returns:
      the default database port number
    • getDefaultOptions

      public Map<String,String> getDefaultOptions()
      Specified by:
      getDefaultOptions in interface DatabaseInterface
      Returns:
      default extra Options
    • supportsSetCharacterStream

      public boolean supportsSetCharacterStream()
      See if this database supports the setCharacterStream() method on a PreparedStatement.
      Specified by:
      supportsSetCharacterStream in interface DatabaseInterface
      Returns:
      true if we can set a Stream on a field in a PreparedStatement. False if not.
    • supportsAutoInc

      public boolean supportsAutoInc()
      Specified by:
      supportsAutoInc in interface DatabaseInterface
      Returns:
      Whether or not the database can use auto increment type of fields (pk)
    • getLimitClause

      public String getLimitClause(int nrRows)
      Specified by:
      getLimitClause in interface DatabaseInterface
      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
    • getNotFoundTK

      public int getNotFoundTK(boolean useAutoinc)
      Description copied from interface: DatabaseInterface
      Get the not found technical key.
      Specified by:
      getNotFoundTK in interface DatabaseInterface
      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.
    • getSQLNextSequenceValue

      public String getSQLNextSequenceValue(String sequenceName)
      Get the SQL to get the next value of a sequence. (Oracle/PGSQL only)
      Specified by:
      getSQLNextSequenceValue in interface DatabaseInterface
      Parameters:
      sequenceName - The sequence name
      Returns:
      the SQL to get the next value of a sequence. (Oracle/PGSQL only)
    • getSQLCurrentSequenceValue

      public String getSQLCurrentSequenceValue(String sequenceName)
      Get the current value of a database sequence
      Specified by:
      getSQLCurrentSequenceValue in interface DatabaseInterface
      Parameters:
      sequenceName - The sequence to check
      Returns:
      The current value of a database sequence
    • getSQLSequenceExists

      public String getSQLSequenceExists(String sequenceName)
      Check if a sequence exists.
      Specified by:
      getSQLSequenceExists in interface DatabaseInterface
      Parameters:
      sequenceName - The sequence to check
      Returns:
      The SQL to get the name of the sequence back from the databases data dictionary
    • isFetchSizeSupported

      public boolean isFetchSizeSupported()
      Checks whether or not the command setFetchSize() is supported by the JDBC driver...
      Specified by:
      isFetchSizeSupported in interface DatabaseInterface
      Returns:
      true is setFetchSize() is supported!
    • needsPlaceHolder

      public boolean needsPlaceHolder()
      Indicates the need to insert a placeholder (0) for auto increment fields.
      Specified by:
      needsPlaceHolder in interface DatabaseInterface
      Returns:
      true if we need a placeholder for auto increment fields in insert statements.
    • supportsSchemas

      public boolean supportsSchemas()
      Specified by:
      supportsSchemas in interface DatabaseInterface
      Returns:
      true if the database supports schemas
    • supportsCatalogs

      public boolean supportsCatalogs()
      Specified by:
      supportsCatalogs in interface DatabaseInterface
      Returns:
      true if the database supports catalogs
    • supportsEmptyTransactions

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

      public String getFunctionSum()
      Specified by:
      getFunctionSum in interface DatabaseInterface
      Returns:
      the function for SUM agrregate
    • getFunctionAverage

      public String getFunctionAverage()
      Specified by:
      getFunctionAverage in interface DatabaseInterface
      Returns:
      the function for Average agrregate
    • getFunctionMinimum

      public String getFunctionMinimum()
      Specified by:
      getFunctionMinimum in interface DatabaseInterface
      Returns:
      the function for Minimum agrregate
    • getFunctionMaximum

      public String getFunctionMaximum()
      Specified by:
      getFunctionMaximum in interface DatabaseInterface
      Returns:
      the function for Maximum agrregate
    • getFunctionCount

      public String getFunctionCount()
      Specified by:
      getFunctionCount in interface DatabaseInterface
      Returns:
      the function for Count agrregate
    • getSchemaTableCombination

      public String getSchemaTableCombination(String schemaName, String tablePart)
      Get the schema-table combination to query the right table. Usually that is SCHEMA.TABLENAME, however there are exceptions to this rule...
      Specified by:
      getSchemaTableCombination in interface DatabaseInterface
      Parameters:
      schemaName - The schema name
      tablePart - The tablename
      Returns:
      the schema-table combination to query the right table.
    • getBackwardsCompatibleSchemaTableCombination

      @Deprecated public String getBackwardsCompatibleSchemaTableCombination(String schemaPart, String tablePart)
      Deprecated.
      we should phase this out in 5.0, but it's there to keep backwards compatibility in the 4.x releases.
      Checks for quotes before quoting schema and table. Many dialects had hardcoded quotes, they probably didn't get updated properly when quoteFields() was introduced to DatabaseMeta.
      Parameters:
      schemaPart -
      tablePart -
      Returns:
      quoted schema and table
    • getBackwardsCompatibleTable

      @Deprecated public String getBackwardsCompatibleTable(String tablePart)
      Deprecated.
      we should phase this out in 5.0, but it's there to keep backwards compatibility in the 4.x releases.
      Checks for quotes before quoting table. Many dialects had hardcoded quotes, they probably didn't get updated properly when quoteFields() was introduced to DatabaseMeta.
      Parameters:
      tablePart -
      Returns:
      quoted table
    • 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!)
      Specified by:
      getMaxTextFieldLength in interface DatabaseInterface
      Returns:
      The maximum text field length for this database type. (mostly CLOB_LENGTH)
    • getMaxVARCHARLength

      public int getMaxVARCHARLength()
      Get the maximum length of a text field (VARCHAR) for this database connection. If this size is exceeded use a CLOB.
      Specified by:
      getMaxVARCHARLength in interface DatabaseInterface
      Returns:
      The maximum VARCHAR field length for this database type. (mostly identical to getMaxTextFieldLength() - CLOB_LENGTH)
    • supportsTransactions

      public boolean supportsTransactions()
      Specified by:
      supportsTransactions in interface DatabaseInterface
      Returns:
      true if the database supports transactions.
    • supportsSequences

      public boolean supportsSequences()
      Specified by:
      supportsSequences in interface DatabaseInterface
      Returns:
      true if the database supports sequences
    • supportsBitmapIndex

      public boolean supportsBitmapIndex()
      Specified by:
      supportsBitmapIndex in interface DatabaseInterface
      Returns:
      true if the database supports bitmap indexes
    • supportsSetLong

      public boolean supportsSetLong()
      Specified by:
      supportsSetLong in interface DatabaseInterface
      Returns:
      true if the database JDBC driver supports the setLong command
    • getDropColumnStatement

      public 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
      Specified by:
      getDropColumnStatement in interface DatabaseInterface
      Parameters:
      tablename - The table to add
      v - The column defined as a value
      tk - the name of the technical key field
      useAutoinc - whether or not this field uses auto increment
      pk - the name of the primary key field
      semicolon - whether or not to add a semi-colon behind the statement.
      Returns:
      the SQL statement to drop a column from the specified table
    • getReservedWords

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

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

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

      public String getEndQuote()
      Specified by:
      getEndQuote in interface DatabaseInterface
      Returns:
      The end quote sequence, mostly just double quote, but sometimes ], ...
    • supportsRepository

      public boolean supportsRepository()
      Specified by:
      supportsRepository in interface DatabaseInterface
      Returns:
      true if Kettle can create a repository on this type of database.
    • getTableTypes

      public String[] getTableTypes()
      Specified by:
      getTableTypes in interface DatabaseInterface
      Returns:
      a list of table types to retrieve tables for the database
    • getViewTypes

      public String[] getViewTypes()
      Specified by:
      getViewTypes in interface DatabaseInterface
      Returns:
      a list of table types to retrieve views for the database
    • getSynonymTypes

      public String[] getSynonymTypes()
      Specified by:
      getSynonymTypes in interface DatabaseInterface
      Returns:
      a list of table types to retrieve synonyms for the database
    • useSchemaNameForTableList

      public boolean useSchemaNameForTableList()
      Specified by:
      useSchemaNameForTableList in interface DatabaseInterface
      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()
      Specified by:
      supportsViews in interface DatabaseInterface
      Returns:
      true if the database supports views
    • supportsSynonyms

      public boolean supportsSynonyms()
      Specified by:
      supportsSynonyms in interface DatabaseInterface
      Returns:
      true if the database supports synonyms
    • getSQLListOfProcedures

      public String getSQLListOfProcedures()
      Specified by:
      getSQLListOfProcedures in interface DatabaseInterface
      Returns:
      The SQL on this database to get a list of stored procedures.
    • getSQLListOfSequences

      public String getSQLListOfSequences()
      Specified by:
      getSQLListOfSequences in interface DatabaseInterface
      Returns:
      The SQL on this database to get a list of sequences.
    • getTruncateTableStatement

      public String getTruncateTableStatement(String tableName)
      Specified by:
      getTruncateTableStatement in interface DatabaseInterface
      Parameters:
      tableName - The table to be truncated.
      Returns:
      The SQL statement to truncate a table: remove all rows from it without a transaction
    • getSQLQueryFields

      public String getSQLQueryFields(String tableName)
      Returns the minimal SQL to launch in order to determine the layout of the resultset for a given database table
      Specified by:
      getSQLQueryFields in interface DatabaseInterface
      Parameters:
      tableName - The name of the table to determine the layout for
      Returns:
      The SQL to launch.
    • supportsFloatRoundingOnUpdate

      public boolean supportsFloatRoundingOnUpdate()
      Most databases round number(7,2) 17.29999999 to 17.30, but some don't.
      Specified by:
      supportsFloatRoundingOnUpdate in interface DatabaseInterface
      Returns:
      true if the database supports roundinf of floating point data on update/insert
    • getSQLLockTables

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

      public String getSQLUnlockTables(String[] tableNames)
      Specified by:
      getSQLUnlockTables in interface DatabaseInterface
      Parameters:
      tableNames - The names of the tables to unlock
      Returns:
      The SQL command to unlock database tables. null is returned in case locking is not supported on the target database. null is the default value
    • supportsTimeStampToDateConversion

      public boolean supportsTimeStampToDateConversion()
      Specified by:
      supportsTimeStampToDateConversion in interface DatabaseInterface
      Returns:
      true if the database supports timestamp to date conversion. For example Interbase doesn't support this!
    • supportsBatchUpdates

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

      public boolean supportsBooleanDataType()
      Specified by:
      supportsBooleanDataType in interface DatabaseInterface
      Returns:
      true if the database supports a boolean, bit, logical, ... datatype The default is false: map to a string.
    • setSupportsBooleanDataType

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

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

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

      public boolean preserveReservedCase()
      Specified by:
      preserveReservedCase in interface DatabaseInterface
      Returns:
      true if reserved words' case should be preserved
    • setPreserveReservedCase

      public void setPreserveReservedCase(boolean b)
      Specified by:
      setPreserveReservedCase in interface DatabaseInterface
      Parameters:
      b - Set to true if reserved words' case should be preserved
    • isDefaultingToUppercase

      public boolean isDefaultingToUppercase()
      Specified by:
      isDefaultingToUppercase in interface DatabaseInterface
      Returns:
      true if the database defaults to naming tables and fields in uppercase. True for most databases except for stuborn stuff like Postgres ;-)
    • getExtraOptions

      public Map<String,String> getExtraOptions()
      Specified by:
      getExtraOptions in interface DatabaseInterface
      Returns:
      all the extra options that are set to be used for the database URL
    • addExtraOption

      public void addExtraOption(String databaseTypeCode, String option, String value)
      Add an extra option to the attributes list
      Specified by:
      addExtraOption in interface DatabaseInterface
      Parameters:
      databaseTypeCode - The database type code for which the option applies
      option - The option to set
      value - The value of the option
    • getExtraOptionSeparator

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

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

      public String getExtraOptionIndicator()
      Specified by:
      getExtraOptionIndicator in interface DatabaseInterface
      Returns:
      This indicator separates the normal URL from the options
    • supportsOptionsInURL

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

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

      public boolean supportsGetBlob()
      Specified by:
      supportsGetBlob in interface DatabaseInterface
      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()
      Specified by:
      getConnectSQL in interface DatabaseInterface
      Returns:
      The SQL to execute right after connecting
    • setConnectSQL

      public void setConnectSQL(String sql)
      Specified by:
      setConnectSQL in interface DatabaseInterface
      Parameters:
      sql - The SQL to execute right after connecting
    • supportsSetMaxRows

      public boolean supportsSetMaxRows()
      Specified by:
      supportsSetMaxRows in interface DatabaseInterface
      Returns:
      true if the database supports setting the maximum number of return rows in a resultset.
    • isUsingConnectionPool

      public boolean isUsingConnectionPool()
      Specified by:
      isUsingConnectionPool in interface DatabaseInterface
      Returns:
      true if we want to use a database connection pool
    • setUsingConnectionPool

      public void setUsingConnectionPool(boolean usePool)
      Specified by:
      setUsingConnectionPool in interface DatabaseInterface
      Parameters:
      usePool - true if we want to use a database connection pool
    • getMaximumPoolSize

      public int getMaximumPoolSize()
      Specified by:
      getMaximumPoolSize in interface DatabaseInterface
      Returns:
      the maximum pool size
    • getMaximumPoolSizeString

      public String getMaximumPoolSizeString()
      Specified by:
      getMaximumPoolSizeString in interface DatabaseInterface
      Returns:
      the maximum pool size variable name
    • setMaximumPoolSize

      public void setMaximumPoolSize(int maximumPoolSize)
      Specified by:
      setMaximumPoolSize in interface DatabaseInterface
      Parameters:
      maximumPoolSize - the maximum pool size
    • setMaximumPoolSizeString

      public void setMaximumPoolSizeString(String maximumPoolSize)
      Specified by:
      setMaximumPoolSizeString in interface DatabaseInterface
      Parameters:
      maximumPoolSize - the maximum pool size variable name
    • getInitialPoolSize

      public int getInitialPoolSize()
      Specified by:
      getInitialPoolSize in interface DatabaseInterface
      Returns:
      the initial pool size
    • getInitialPoolSizeString

      public String getInitialPoolSizeString()
      Specified by:
      getInitialPoolSizeString in interface DatabaseInterface
      Returns:
      the initial pool size variable name
    • setInitialPoolSize

      public void setInitialPoolSize(int initialPoolSize)
      Specified by:
      setInitialPoolSize in interface DatabaseInterface
      Parameters:
      initialPoolSize - the initial pool size
    • setInitialPoolSizeString

      public void setInitialPoolSizeString(String initialPoolSize)
      Specified by:
      setInitialPoolSizeString in interface DatabaseInterface
      Parameters:
      initialPoolSize - the initial pool size variable name
    • isPartitioned

      public boolean isPartitioned()
      Specified by:
      isPartitioned in interface DatabaseInterface
      Returns:
      true if we want to use a database connection pool
    • setPartitioned

      public void setPartitioned(boolean clustered)
      Specified by:
      setPartitioned in interface DatabaseInterface
      Parameters:
      clustered - true if we want to use a database connection pool
    • getPartitioningInformation

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

      public void setPartitioningInformation(PartitionDatabaseMeta[] clusterInfo)
      Specified by:
      setPartitioningInformation in interface DatabaseInterface
      Parameters:
      clusterInfo - the available partition/host/databases/port combinations in the cluster
    • getConnectionPoolingProperties

      public Properties getConnectionPoolingProperties()
      Specified by:
      getConnectionPoolingProperties in interface DatabaseInterface
      Returns:
      The set of properties (newly created object) that contains the connection pooling parameters All environment variables will be replaced here.
    • setConnectionPoolingProperties

      public void setConnectionPoolingProperties(Properties properties)
      Description copied from interface: DatabaseInterface
      set the connection pooling properties
      Specified by:
      setConnectionPoolingProperties in interface DatabaseInterface
    • getSQLTableExists

      public String getSQLTableExists(String tablename)
      Specified by:
      getSQLTableExists in interface DatabaseInterface
      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

      public String getSQLColumnExists(String columnname, String tablename)
      Specified by:
      getSQLColumnExists in interface DatabaseInterface
      Parameters:
      columnname - The column to verify the existance for
      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 column.
    • needsToLockAllTables

      public boolean needsToLockAllTables()
      Specified by:
      needsToLockAllTables in interface DatabaseInterface
      Returns:
      true if the database needs all repository tables to be locked, not just one ref table (R_REPOSITORY_LOG)
    • isStreamingResults

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

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

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

      public void setQuoteAllFields(boolean quoteAllFields)
      Specified by:
      setQuoteAllFields in interface DatabaseInterface
      Parameters:
      quoteAllFields - true if we want the database to stream results (normally this is an option just for MySQL).
    • isForcingIdentifiersToLowerCase

      public boolean isForcingIdentifiersToLowerCase()
      Specified by:
      isForcingIdentifiersToLowerCase in interface DatabaseInterface
      Returns:
      true if all identifiers should be forced to lower case
    • setForcingIdentifiersToLowerCase

      public void setForcingIdentifiersToLowerCase(boolean forceLowerCase)
      Specified by:
      setForcingIdentifiersToLowerCase in interface DatabaseInterface
      Parameters:
      forceLowerCase - true if all identifiers should be forced to lower case
    • isForcingIdentifiersToUpperCase

      public boolean isForcingIdentifiersToUpperCase()
      Specified by:
      isForcingIdentifiersToUpperCase in interface DatabaseInterface
      Returns:
      true if all identifiers should be forced to upper case
    • setForcingIdentifiersToUpperCase

      public void setForcingIdentifiersToUpperCase(boolean forceUpperCase)
      Specified by:
      setForcingIdentifiersToUpperCase in interface DatabaseInterface
      Parameters:
      forceUpperCase - true if all identifiers should be forced to upper case
    • isUsingDoubleDecimalAsSchemaTableSeparator

      public boolean isUsingDoubleDecimalAsSchemaTableSeparator()
      Specified by:
      isUsingDoubleDecimalAsSchemaTableSeparator in interface DatabaseInterface
      Returns:
      true if we use a double decimal separator to specify schema/table combinations on MS-SQL server
    • setUsingDoubleDecimalAsSchemaTableSeparator

      public void setUsingDoubleDecimalAsSchemaTableSeparator(boolean useDoubleDecimalSeparator)
      Specified by:
      setUsingDoubleDecimalAsSchemaTableSeparator in interface DatabaseInterface
      Parameters:
      useDoubleDecimalSeparator - true if we should use a double decimal separator to specify schema/table combinations on MS-SQL server
    • isRequiringTransactionsOnQueries

      public boolean isRequiringTransactionsOnQueries()
      Specified by:
      isRequiringTransactionsOnQueries in interface DatabaseInterface
      Returns:
      true if this database needs a transaction to perform a query (auto-commit turned off).
    • getDatabaseFactoryName

      public 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.
      Specified by:
      getDatabaseFactoryName in interface DatabaseInterface
      Returns:
      the name of the database test factory to use.
    • getPreferredSchemaName

      public String getPreferredSchemaName()
      Specified by:
      getPreferredSchemaName in interface DatabaseInterface
      Returns:
      The preferred schema name of this database connection.
    • setPreferredSchemaName

      public void setPreferredSchemaName(String preferredSchemaName)
      Specified by:
      setPreferredSchemaName in interface DatabaseInterface
      Parameters:
      preferredSchemaName - The preferred schema name of this database connection.
    • checkIndexExists

      public 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.
      Specified by:
      checkIndexExists in interface DatabaseInterface
      Parameters:
      database - a connected database
      schemaName -
      tableName -
      idxFields -
      Returns:
      true if the index exists, false if it doesn't.
      Throws:
      KettleDatabaseException
    • supportsSequenceNoMaxValueOption

      public boolean supportsSequenceNoMaxValueOption()
      Specified by:
      supportsSequenceNoMaxValueOption in interface DatabaseInterface
      Returns:
      true if the database supports the NOMAXVALUE sequence option. The default is false, AS/400 and DB2 support this.
    • requiresCreateTablePrimaryKeyAppend

      public boolean requiresCreateTablePrimaryKeyAppend()
      Specified by:
      requiresCreateTablePrimaryKeyAppend in interface DatabaseInterface
      Returns:
      true if we need to append the PRIMARY KEY block in the create table block after the fields, required for Cache.
    • requiresCastToVariousForIsNull

      public boolean requiresCastToVariousForIsNull()
      Specified by:
      requiresCastToVariousForIsNull in interface DatabaseInterface
      Returns:
      true if the database requires you to cast a parameter to varchar before comparing to null. Only required for DB2 and Vertica
    • isDisplaySizeTwiceThePrecision

      public boolean isDisplaySizeTwiceThePrecision()
      Specified by:
      isDisplaySizeTwiceThePrecision in interface DatabaseInterface
      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

      public boolean supportsPreparedStatementMetadataRetrieval()
      Most databases allow you to retrieve result metadata by preparing a SELECT statement.
      Specified by:
      supportsPreparedStatementMetadataRetrieval in interface DatabaseInterface
      Returns:
      true if the database supports retrieval of query metadata from a prepared statement. False if the query needs to be executed first.
    • supportsResultSetMetadataRetrievalOnly

      public boolean supportsResultSetMetadataRetrievalOnly()
      Specified by:
      supportsResultSetMetadataRetrievalOnly in interface DatabaseInterface
      Returns:
      true if this database only supports metadata retrieval on a result set, never on a statement (even if the statement has been executed)
    • isSystemTable

      public boolean isSystemTable(String tableName)
      Specified by:
      isSystemTable in interface DatabaseInterface
      Parameters:
      tableName -
      Returns:
      true if the specified table is a system table
    • supportsNewLinesInSQL

      public boolean supportsNewLinesInSQL()
      Specified by:
      supportsNewLinesInSQL in interface DatabaseInterface
      Returns:
      true if the database supports newlines in a SQL statements.
    • getSQLListOfSchemas

      public String getSQLListOfSchemas()
      Specified by:
      getSQLListOfSchemas in interface DatabaseInterface
      Returns:
      the SQL to retrieve the list of schemas or null if the JDBC metadata needs to be used.
    • getMaxColumnsInIndex

      public int getMaxColumnsInIndex()
      Specified by:
      getMaxColumnsInIndex in interface DatabaseInterface
      Returns:
      The maximum number of columns in a database, <=0 means: no known limit
    • supportsErrorHandlingOnBatchUpdates

      public boolean supportsErrorHandlingOnBatchUpdates()
      Specified by:
      supportsErrorHandlingOnBatchUpdates in interface DatabaseInterface
      Returns:
      true if the database supports error handling (recovery of failure) while doing batch updates.
    • getSQLInsertAutoIncUnknownDimensionRow

      public String getSQLInsertAutoIncUnknownDimensionRow(String schemaTable, String keyField, String versionField)
      Get the SQL to insert a new empty unknown record in a dimension.
      Specified by:
      getSQLInsertAutoIncUnknownDimensionRow in interface DatabaseInterface
      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()
      Specified by:
      isExplorable in interface DatabaseInterface
      Returns:
      true if this is a relational database you can explore. Return false for SAP, PALO, etc.
    • getXulOverlayFile

      public String getXulOverlayFile()
      Specified by:
      getXulOverlayFile in interface DatabaseInterface
      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.
    • quoteSQLString

      public String quoteSQLString(String string)
      Description copied from interface: DatabaseInterface
      Adds quotes around the string according to the database dialect and also escapes special characters like CR, LF and the quote character itself.
      Specified by:
      quoteSQLString in interface DatabaseInterface
      Parameters:
      string -
      Returns:
      A string that is properly quoted for use in a SQL statement (insert, update, delete, etc)
    • getSelectCountStatement

      public String getSelectCountStatement(String tableName)
      Build the SQL to count the number of rows in the passed table.
      Specified by:
      getSelectCountStatement in interface DatabaseInterface
      Parameters:
      tableName -
      Returns:
    • generateColumnAlias

      public String generateColumnAlias(int columnIndex, String suggestedName)
      Description copied from interface: DatabaseInterface
      Generate a column alias given the column index and suggested name.
      Specified by:
      generateColumnAlias in interface DatabaseInterface
      Parameters:
      columnIndex - Index of column in query
      suggestedName - Suggested column name
      Returns:
      Column alias that is valid for this database
    • parseStatements

      public List<String> parseStatements(String sqlScript)
      Parse all possible statements from the provided SQL script.
      Specified by:
      parseStatements in interface DatabaseInterface
      Parameters:
      sqlScript - Raw SQL Script to be parsed into executable statements.
      Returns:
      List of parsed SQL statements to be executed separately.
    • getSqlScriptStatements

      public List<SqlScriptStatement> getSqlScriptStatements(String sqlScript)
      Parse the statements in the provided SQL script, provide more information about where each was found in the script.
      Specified by:
      getSqlScriptStatements in interface DatabaseInterface
      Parameters:
      sqlScript - Raw SQL Script to be parsed into executable statements.
      Returns:
      List of SQL script statements to be executed separately.
    • onlySpaces

      protected boolean onlySpaces(String str)
      Parameters:
      str -
      Returns:
      True if str contains only spaces.
    • isMySQLVariant

      public boolean isMySQLVariant()
      Specified by:
      isMySQLVariant in interface DatabaseInterface
      Returns:
      true if the database is a MySQL variant, like MySQL 5.1, InfiniDB, InfoBright, and so on.
    • canTest

      public boolean canTest()
      Returns:
      true if the database type can be tested against a database instance
    • requiresName

      public boolean requiresName()
      Returns:
      true if the database name is a required parameter
    • releaseSavepoint

      public boolean releaseSavepoint()
      Returns a true of savepoints can be released, false if not.
      Specified by:
      releaseSavepoint in interface DatabaseInterface
      Returns:
    • getNextBatchIdUsingSequence

      public Long getNextBatchIdUsingSequence(String sequenceName, String schemaName, DatabaseMeta dbm, Database ldb) throws KettleDatabaseException
      Throws:
      KettleDatabaseException
    • getNextBatchIdUsingAutoIncSQL

      public Long getNextBatchIdUsingAutoIncSQL(String autoIncSQL, DatabaseMeta dbm, Database ldb) throws KettleDatabaseException
      Throws:
      KettleDatabaseException
    • getNextBatchIdUsingLockTables

      public Long getNextBatchIdUsingLockTables(DatabaseMeta dbm, Database ldb, String schemaName, String tableName, String fieldName) throws KettleDatabaseException
      Throws:
      KettleDatabaseException
    • getNextBatchId

      public Long getNextBatchId(DatabaseMeta dbm, Database ldb, String schemaName, String tableName, String fieldName) throws KettleDatabaseException
      Description copied from interface: DatabaseInterface
      Get the next Batch ID from the logging tables.
      Specified by:
      getNextBatchId in interface DatabaseInterface
      Parameters:
      dbm - DatabaseMeta object
      ldb - Database connection
      schemaName - Logging Schema Name
      tableName - Logging Table Name
      fieldName - Batch Id Field name
      Returns:
      next batch ID
      Throws:
      KettleDatabaseException
    • getDataTablespaceDDL

      public String getDataTablespaceDDL(VariableSpace variables, DatabaseMeta databaseMeta)
      Returns the tablespace DDL fragment for a "Data" tablespace. In most databases that use tablespaces this is where the tables are to be created.
      Specified by:
      getDataTablespaceDDL in interface DatabaseInterface
      Parameters:
      variables - variables used for possible substitution
      databaseMeta - 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

      public String getIndexTablespaceDDL(VariableSpace variables, DatabaseMeta databaseMeta)
      Returns the tablespace DDL fragment for a "Index" tablespace.
      Specified by:
      getIndexTablespaceDDL in interface DatabaseInterface
      Parameters:
      variables - variables used for possible substitution
      databaseMeta - 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 indices in the format "tablespace TABLESPACE_NAME". The TABLESPACE_NAME and the passed DatabaseMata determines if TABLESPACE_NAME is to be enclosed in quotes.
    • getTablespaceDDL

      public String getTablespaceDDL(VariableSpace variables, DatabaseMeta databaseMeta, String tablespaceName)
      Returns an empty string as most databases do not support tablespaces. Subclasses can override this method to generate the DDL.
      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.
      tablespaceName - tablespaceName name of the tablespace.
      Returns:
      String an empty String as most databases do not use tablespaces.
    • getValueFromResultSet

      public Object getValueFromResultSet(ResultSet rs, ValueMetaInterface val, int i) throws KettleDatabaseException
      This method allows a database dialect to convert database specific data types to Kettle data types.
      Specified by:
      getValueFromResultSet in interface DatabaseInterface
      Parameters:
      rs - The result set to use
      val - The description of the value to retrieve
      i - 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

      public boolean useSafePoints()
      Specified by:
      useSafePoints in interface DatabaseInterface
      Returns:
      true if the database supports the use of safe-points and if it is appropriate to ever use it (default to false)
    • supportsErrorHandling

      public boolean supportsErrorHandling()
      Specified by:
      supportsErrorHandling in interface DatabaseInterface
      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

      public String getSQLValue(ValueMetaInterface valueMeta, Object valueData, String dateFormat) throws KettleValueException
      Description copied from interface: DatabaseInterface
      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')
      Specified by:
      getSQLValue in interface DatabaseInterface
      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.
    • getFieldnameProtector

      protected String getFieldnameProtector()
    • getSafeFieldname

      public String getSafeFieldname(String fieldName)
      Sanitize a string for usage as a field name
      • Append an underscore to any field name that matches a reserved word
      • Replaces spaces with underscores
      • Prefixes a string with underscore that begins with a number
      Specified by:
      getSafeFieldname in interface DatabaseInterface
      Parameters:
      fieldName - value to sanitize
      Returns:
    • getSequenceNoMaxValueOption

      public String getSequenceNoMaxValueOption()
      Specified by:
      getSequenceNoMaxValueOption in interface DatabaseInterface
      Returns:
      string with the no max value sequence option.
    • supportsAutoGeneratedKeys

      public boolean supportsAutoGeneratedKeys()
      Specified by:
      supportsAutoGeneratedKeys in interface DatabaseInterface
      Returns:
      true if the database supports autoGeneratedKeys
    • customizeValueFromSQLType

      public ValueMetaInterface customizeValueFromSQLType(ValueMetaInterface v, ResultSetMetaData rm, int index) throws SQLException
      Customizes the ValueMetaInterface defined in the base
      Specified by:
      customizeValueFromSQLType in interface DatabaseInterface
      Parameters:
      v - the determined valueMetaInterface
      rm - the sql result
      index - the index to the column
      Returns:
      ValueMetaInterface customized with the data base specific types
      Throws:
      SQLException
    • getCreateTableStatement

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

      public String getDropTableIfExistsStatement(String tableName)
      Forms drop table statement. This standard construct syntax is not legal for certain RDBMSs, and should be overridden according to their specifics.
      Specified by:
      getDropTableIfExistsStatement in interface DatabaseInterfaceExtended
      Parameters:
      tableName - Name of the table to drop
      Returns:
      Standard drop table statement
    • fullExceptionLog

      public boolean fullExceptionLog(Exception e)
      Description copied from interface: DatabaseInterfaceExtended
      Returns false if exception doesn't require full exception log. Could be used in cases of DB vendor specific error which doesn't require stack trace log.
      Specified by:
      fullExceptionLog in interface DatabaseInterfaceExtended
      Parameters:
      e - exception to check
      Returns:
      decision result
    • addDefaultOptions

      public void addDefaultOptions()
      Description copied from interface: DatabaseInterface
      Set default options for this database
      Specified by:
      addDefaultOptions in interface DatabaseInterface
    • addAttribute

      public void addAttribute(String attributeId, String value)
      Description copied from interface: DatabaseInterface
      Add extra attribute on this connection
      Specified by:
      addAttribute in interface DatabaseInterface
      Parameters:
      attributeId - the attribute identifier
      value - the value of the attribute
    • getAttribute

      public String getAttribute(String attributeId, String defaultValue)
      Description copied from interface: DatabaseInterface
      Gets an attribute from the connection
      Specified by:
      getAttribute in interface DatabaseInterface
      Parameters:
      attributeId - the attribute identifier
      defaultValue - the default value in case the attribute is not found
      Returns:
      the attribute value
    • setNamedCluster

      public void setNamedCluster(String namedCluster)
      Description copied from interface: DatabaseInterface
      Set the hadoop cluster associated with the connection
      Specified by:
      setNamedCluster in interface DatabaseInterface
      Parameters:
      namedCluster - The hadoop cluster name
    • getNamedCluster

      public String getNamedCluster()
      Specified by:
      getNamedCluster in interface DatabaseInterface
      Returns:
      The hadoop cluster associated with the connection