org.pentaho.di.core.database
Interface DatabaseInterface

All Superinterfaces:
Cloneable
All Known Implementing Classes:
AS400DatabaseMeta, CacheDatabaseMeta, DB2DatabaseMeta, DbaseDatabaseMeta, DerbyDatabaseMeta, Exasol4DatabaseMeta, ExtenDBDatabaseMeta, FirebirdDatabaseMeta, GenericDatabaseMeta, GreenplumDatabaseMeta, GuptaDatabaseMeta, H2DatabaseMeta, HypersonicDatabaseMeta, InfiniDbDatabaseMeta, InfobrightDatabaseMeta, InformixDatabaseMeta, IngresDatabaseMeta, InterbaseDatabaseMeta, KingbaseESDatabaseMeta, LucidDBDatabaseMeta, MonetDBDatabaseMeta, MSAccessDatabaseMeta, MSSQLServerDatabaseMeta, MSSQLServerNativeDatabaseMeta, MySQLDatabaseMeta, NeoviewDatabaseMeta, NetezzaDatabaseMeta, OracleDatabaseMeta, OracleRDBDatabaseMeta, PostgreSQLDatabaseMeta, RemedyActionRequestSystemDatabaseMeta, SAPDBDatabaseMeta, SAPR3DatabaseMeta, SQLiteDatabaseMeta, SybaseDatabaseMeta, SybaseIQDatabaseMeta, TeradataDatabaseMeta, UniVerseDatabaseMeta, VectorWiseDatabaseMeta, Vertica5DatabaseMeta, VerticaDatabaseMeta

public interface DatabaseInterface
extends Cloneable

This interface describes the methods that a database connection needs to have in order to describe it properly.

Since:
11-mrt-2005
Author:
Matt

Method Summary
 void addExtraOption(String databaseTypeCode, String option, String value)
          Add an extra option to the attributes list
 boolean checkIndexExists(Database database, String schemaName, String tableName, String[] idxFields)
          Verifies on the specified database connection if an index exists on the fields with the specified name.
 Object clone()
          Clone this database interface: copy all info to a new object
 String generateColumnAlias(int columnIndex, String suggestedName)
          Generate a column alias given the column index and suggested name.
 int getAccessType()
           
 int[] getAccessTypeList()
          Get the list of possible access types for a database.
 String getAddColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon)
          Generates the SQL statement to add a column to the specified table
 Properties getAttributes()
           
 Properties getConnectionPoolingProperties()
           
 String getConnectSQL()
           
 String getDatabaseFactoryName()
          You can use this method to supply an alternate factory for the test method in the dialogs.
 String getDatabaseName()
           
 String getDatabasePortNumberString()
           
 String getDataTablespace()
           
 String getDataTablespaceDDL(VariableSpace variables, DatabaseMeta databaseMeta)
          Returns the tablespace DDL fragment for a "Data" tablespace.
 int getDefaultDatabasePort()
           
 String getDriverClass()
          Obtain the name of the JDBC driver class that we need to use!
 String getDropColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon)
          Generates the SQL statement to drop a column from the specified table
 String getEndQuote()
           
 String getExtraOptionIndicator()
           
 Map<String,String> getExtraOptions()
           
 String getExtraOptionSeparator()
           
 String getExtraOptionsHelpText()
           
 String getExtraOptionValueSeparator()
           
 String getFieldDefinition(ValueMetaInterface v, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr)
          Describe a Value as a field in the database.
 String getFunctionAverage()
           
 String getFunctionCount()
           
 String getFunctionMaximum()
           
 String getFunctionMinimum()
           
 String getFunctionSum()
           
 String getHostname()
           
 String getIndexTablespace()
           
 String getIndexTablespaceDDL(VariableSpace variables, DatabaseMeta databaseMeta)
          Returns the tablespace DDL fragment for a "Index" tablespace.
 int getInitialPoolSize()
           
 String getLimitClause(int nrRows)
           
 int getMaxColumnsInIndex()
           
 int getMaximumPoolSize()
           
 int getMaxTextFieldLength()
          Get the maximum length of a text field for this database connection.
 int getMaxVARCHARLength()
          Get the maximum length of a text field (VARCHAR) for this database connection.
 String getModifyColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon)
          Generates the SQL statement to modify a column in the specified table
 String getName()
           
 Long getNextBatchId(DatabaseMeta dbm, Database ldb, String schemaName, String tableName, String fieldName)
          Get the next Batch ID from the logging tables.
 int getNotFoundTK(boolean use_autoinc)
          Get the not found technical key.
 ObjectId getObjectId()
           
 PartitionDatabaseMeta[] getPartitioningInformation()
           
 String getPassword()
           
 String getPluginId()
           
 String getPluginName()
           
 String getPreferredSchemaName()
           
 String[] getReservedWords()
           
 String getSchemaTableCombination(String schema_name, String table_part)
          Get the schema-table combination to query the right table.
 String getSelectCountStatement(String tableName)
          Returns the SQL Statement that counts the number of rows in the table.
 String getServername()
           
 String getSQLColumnExists(String column, String tablename)
           
 String getSQLCurrentSequenceValue(String sequenceName)
          Get the current value of a database sequence
 String getSQLInsertAutoIncUnknownDimensionRow(String schemaTable, String keyField, String versionField)
          Get the SQL to insert a new empty unknown record in a dimension.
 String getSQLListOfProcedures()
           
 String getSQLListOfSchemas()
           
 String getSQLListOfSequences()
           
 String getSQLLockTables(String[] tableNames)
           
 String getSQLNextSequenceValue(String sequenceName)
          Get the SQL to get the next value of a sequence.
 String getSQLQueryFields(String tableName)
          Returns the minimal SQL to launch in order to determine the layout of the resultset for a given database table
 String getSQLSequenceExists(String sequenceName)
          Check if a sequence exists.
 String getSQLTableExists(String tablename)
           
 String getSQLUnlockTables(String[] tableNames)
           
 String getStartQuote()
           
 String[] getSynonymTypes()
           
 String[] getTableTypes()
           
 String getTruncateTableStatement(String tableName)
           
 String getURL(String hostname, String port, String databaseName)
           
 String[] getUsedLibraries()
           
 String getUsername()
           
 Object getValueFromResultSet(ResultSet resultSet, ValueMetaInterface valueMeta, int index)
          This method allows a database dialect to convert database specific data types to Kettle data types.
 String[] getViewTypes()
           
 String getXulOverlayFile()
           
 boolean isChanged()
           
 boolean isDefaultingToUppercase()
           
 boolean isDisplaySizeTwiceThePrecision()
           
 boolean isExplorable()
           
 boolean isFetchSizeSupported()
          Checks whether or not the command setFetchSize() is supported by the JDBC driver...
 boolean isForcingIdentifiersToLowerCase()
           
 boolean isForcingIdentifiersToUpperCase()
           
 boolean isMySQLVariant()
           
 boolean isPartitioned()
           
 boolean isQuoteAllFields()
           
 boolean isRequiringTransactionsOnQueries()
           
 boolean isStreamingResults()
           
 boolean isSystemTable(String tableName)
           
 boolean isUsingConnectionPool()
           
 boolean isUsingDoubleDecimalAsSchemaTableSeparator()
           
 boolean needsPlaceHolder()
          Indicates the need to insert a placeholder (0) for auto increment fields.
 boolean needsToLockAllTables()
           
 List<String> parseStatements(String sqlScript)
          Parse all possible statements from the provided SQL script.
 boolean quoteReservedWords()
           
 String quoteSQLString(String string)
           
 boolean releaseSavepoint()
          Returns a true of savepoints can be release, false if not.
 boolean requiresCastToVariousForIsNull()
           
 boolean requiresCreateTablePrimaryKeyAppend()
           
 void setAccessType(int accessType)
           
 void setAttributes(Properties attributes)
          Set extra attributes on this database connection
 void setChanged(boolean changed)
           
 void setConnectionPoolingProperties(Properties properties)
          set the connection pooling properties
 void setConnectSQL(String sql)
           
 void setDatabaseName(String databaseName)
           
 void setDatabasePortNumberString(String databasePortNumberString)
           
 void setDataTablespace(String data_tablespace)
           
 void setForcingIdentifiersToLowerCase(boolean forceLowerCase)
           
 void setForcingIdentifiersToUpperCase(boolean forceUpperCase)
           
 void setHostname(String hostname)
           
 void setIndexTablespace(String index_tablespace)
           
 void setInitialPoolSize(int initalPoolSize)
           
 void setMaximumPoolSize(int maximumPoolSize)
           
 void setName(String name)
           
 void setObjectId(ObjectId id)
           
 void setPartitioned(boolean partitioned)
           
 void setPartitioningInformation(PartitionDatabaseMeta[] partitionInfo)
           
 void setPassword(String password)
           
 void setPluginId(String pluginId)
           
 void setPluginName(String pluginName)
           
 void setPreferredSchemaName(String preferredSchemaName)
           
 void setQuoteAllFields(boolean quoteAllFields)
           
 void setServername(String servername)
           
 void setStreamingResults(boolean useStreaming)
           
 void setSupportsBooleanDataType(boolean b)
           
 void setUsername(String username)
           
 void setUsingConnectionPool(boolean usePool)
           
 void setUsingDoubleDecimalAsSchemaTableSeparator(boolean useDoubleDecimalSeparator)
           
 boolean supportsAutoInc()
           
 boolean supportsBatchUpdates()
           
 boolean supportsBitmapIndex()
           
 boolean supportsBooleanDataType()
           
 boolean supportsCatalogs()
           
 boolean supportsEmptyTransactions()
           
 boolean supportsErrorHandling()
           
 boolean supportsErrorHandlingOnBatchUpdates()
           
 boolean supportsFloatRoundingOnUpdate()
           
 boolean supportsGetBlob()
           
 boolean supportsNewLinesInSQL()
           
 boolean supportsOptionsInURL()
           
 boolean supportsPreparedStatementMetadataRetrieval()
          Most databases allow you to retrieve result metadata by preparing a SELECT statement.
 boolean supportsRepository()
           
 boolean supportsResultSetMetadataRetrievalOnly()
           
 boolean supportsSchemas()
           
 boolean supportsSequenceNoMaxValueOption()
           
 boolean supportsSequences()
           
 boolean supportsSetCharacterStream()
          See if this database supports the setCharacterStream() method on a PreparedStatement.
 boolean supportsSetLong()
           
 boolean supportsSetMaxRows()
           
 boolean supportsSynonyms()
           
 boolean supportsTimeStampToDateConversion()
           
 boolean supportsTransactions()
           
 boolean supportsViews()
           
 boolean useSafePoints()
           
 boolean useSchemaNameForTableList()
           
 

Method Detail

getPluginId

String getPluginId()
Returns:
the plugin id of this database

setPluginId

void setPluginId(String pluginId)
Parameters:
pluginId - set the plugin id of this plugin (after instantiation)

getPluginName

String getPluginName()
Returns:
the plugin name of this database, the same thing as the annotation typeDescription

setPluginName

void setPluginName(String pluginName)
Parameters:
pluginName - set the plugin name of this plugin (after instantiation)

getAccessType

int getAccessType()
Returns:
Returns the accessType.

setAccessType

void setAccessType(int accessType)
Parameters:
accessType - The accessType to set.

isChanged

boolean isChanged()
Returns:
Returns the changed.

setChanged

void setChanged(boolean changed)
Parameters:
changed - The changed to set.

getName

String getName()
Returns:
Returns the connection Name.

setName

void setName(String name)
Parameters:
name - The connection Name to set.

getDatabaseName

String getDatabaseName()
Returns:
Returns the databaseName.

setDatabaseName

void setDatabaseName(String databaseName)
Parameters:
databaseName - The databaseName to set.

getDatabasePortNumberString

String getDatabasePortNumberString()
Returns:
Returns the databasePortNumber as a string.

setDatabasePortNumberString

void setDatabasePortNumberString(String databasePortNumberString)
Parameters:
databasePortNumberString - The databasePortNumber to set as a string.

getHostname

String getHostname()
Returns:
Returns the hostname.

setHostname

void setHostname(String hostname)
Parameters:
hostname - The hostname to set.

getObjectId

ObjectId getObjectId()
Returns:
Returns the id.

setObjectId

void setObjectId(ObjectId id)
Parameters:
id - The id to set.

getUsername

String getUsername()
Returns:
the username to log onto the database

setUsername

void setUsername(String username)
Parameters:
username - Sets the username to log onto the database with.

getPassword

String getPassword()
Returns:
Returns the password.

setPassword

void setPassword(String password)
Parameters:
password - The password to set.

getServername

String getServername()
Returns:
Returns the servername.

setServername

void setServername(String servername)
Parameters:
servername - The servername to set.

getDataTablespace

String getDataTablespace()
Returns:
the tablespace to store data in. (create table)

setDataTablespace

void setDataTablespace(String data_tablespace)
Parameters:
data_tablespace - the tablespace to store data in

getIndexTablespace

String getIndexTablespace()
Returns:
the tablespace to store indexes in

setIndexTablespace

void setIndexTablespace(String index_tablespace)
Parameters:
index_tablespace - the tablespace to store indexes in

getAttributes

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

setAttributes

void setAttributes(Properties attributes)
Set extra attributes on this database connection

Parameters:
attributes - The extra attributes to set on this database connection.

supportsSetCharacterStream

boolean supportsSetCharacterStream()
See if this database supports the setCharacterStream() method on a PreparedStatement.

Returns:
true if we can set a Stream on a field in a PreparedStatement. False if not.

supportsAutoInc

boolean supportsAutoInc()
Returns:
Whether or not the database can use auto increment type of fields (pk)

getFieldDefinition

String getFieldDefinition(ValueMetaInterface v,
                          String tk,
                          String pk,
                          boolean use_autoinc,
                          boolean add_fieldname,
                          boolean add_cr)
Describe a Value as a field in the database.

Parameters:
v - The value to describe
tk - The field that's going to be the technical key
pk - The field that's going to be the primary key
use_autoinc - Use autoincrement or not
add_fieldname - Add the fieldname to the definition or not
add_cr - Add a cariage return at the end of the definition or not.
Returns:
a value described as a field in this database.

getAccessTypeList

int[] getAccessTypeList()
Get the list of possible access types for a database.

Returns:
the list of possible access types for a database.

getDefaultDatabasePort

int getDefaultDatabasePort()
Returns:
the default database port number

getLimitClause

String getLimitClause(int nrRows)
Parameters:
nrRows - The number of rows to which we want to limit the result of the query.
Returns:
the clause after a select statement to limit the number of rows

getSQLQueryFields

String getSQLQueryFields(String tableName)
Returns the minimal SQL to launch in order to determine the layout of the resultset for a given database table

Parameters:
tableName - The name of the table to determine the layout for
Returns:
The SQL to launch.

getNotFoundTK

int getNotFoundTK(boolean use_autoinc)
Get the not found technical key.

Parameters:
use_autoinc - Whether or not we want to use an auto increment field
Returns:
the lowest possible technical key to be used as the NOT FOUND row in a slowly changing dimension.

getDriverClass

String getDriverClass()
Obtain the name of the JDBC driver class that we need to use!

Returns:
the name of the JDBC driver class for the specific database

getURL

String getURL(String hostname,
              String port,
              String databaseName)
              throws KettleDatabaseException
Parameters:
hostname - the hostname
port - the port as a string
databaseName - the database name
Returns:
the URL to use for connecting to the database.
Throws:
KettleDatabaseException - in case a configuration error is detected.

supportsSequences

boolean supportsSequences()
Returns:
true if the database supports sequences

getSQLNextSequenceValue

String getSQLNextSequenceValue(String sequenceName)
Get the SQL to get the next value of a sequence.

Parameters:
sequenceName - The sequence name
Returns:
the SQL to get the next value of a sequence.

getSQLCurrentSequenceValue

String getSQLCurrentSequenceValue(String sequenceName)
Get the current value of a database sequence

Parameters:
sequenceName - The sequence to check
Returns:
The current value of a database sequence

getSQLSequenceExists

String getSQLSequenceExists(String sequenceName)
Check if a sequence exists.

Parameters:
sequenceName - The sequence to check
Returns:
The SQL to get the name of the sequence back from the databases data dictionary

isFetchSizeSupported

boolean isFetchSizeSupported()
Checks whether or not the command setFetchSize() is supported by the JDBC driver...

Returns:
true is setFetchSize() is supported!

supportsTransactions

boolean supportsTransactions()
Returns:
true if the database supports transactions.

supportsBitmapIndex

boolean supportsBitmapIndex()
Returns:
true if the database supports bitmap indexes

supportsSetLong

boolean supportsSetLong()
Returns:
true if the database JDBC driver supports the setLong command

supportsSchemas

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

supportsCatalogs

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

supportsEmptyTransactions

boolean supportsEmptyTransactions()
Returns:
true when the database engine supports empty transaction. (for example Informix does not!)

needsPlaceHolder

boolean needsPlaceHolder()
Indicates the need to insert a placeholder (0) for auto increment fields.

Returns:
true if we need a placeholder for auto increment fields in insert statements.

getFunctionSum

String getFunctionSum()
Returns:
the function for Sum agrregate

getFunctionAverage

String getFunctionAverage()
Returns:
the function for Average agrregate

getFunctionMinimum

String getFunctionMinimum()
Returns:
the function for Minimum agrregate

getFunctionMaximum

String getFunctionMaximum()
Returns:
the function for Maximum agrregate

getFunctionCount

String getFunctionCount()
Returns:
the function for Count agrregate

getSchemaTableCombination

String getSchemaTableCombination(String schema_name,
                                 String table_part)
Get the schema-table combination to query the right table. Usually that is SCHEMA.TABLENAME, however there are exceptions to this rule...

Parameters:
schema_name - The schema name
table_part - The tablename
Returns:
the schema-table combination to query the right table.

getMaxTextFieldLength

int getMaxTextFieldLength()
Get the maximum length of a text field for this database connection. This includes optional CLOB, Memo and Text fields. (the maximum!)

Returns:
The maximum text field length for this database type. (mostly CLOB_LENGTH)

getMaxVARCHARLength

int getMaxVARCHARLength()
Get the maximum length of a text field (VARCHAR) for this database connection. If this size is exceeded use a CLOB.

Returns:
The maximum VARCHAR field length for this database type. (mostly identical to getMaxTextFieldLength() - CLOB_LENGTH)

getAddColumnStatement

String getAddColumnStatement(String tablename,
                             ValueMetaInterface v,
                             String tk,
                             boolean use_autoinc,
                             String pk,
                             boolean semicolon)
Generates the SQL statement to add a column to the specified table

Parameters:
tablename - The table to add
v - The column defined as a value
tk - the name of the technical key field
use_autoinc - 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 add a column to the specified table

getDropColumnStatement

String getDropColumnStatement(String tablename,
                              ValueMetaInterface v,
                              String tk,
                              boolean use_autoinc,
                              String pk,
                              boolean semicolon)
Generates the SQL statement to drop a column from the specified table

Parameters:
tablename - The table to add
v - The column defined as a value
tk - the name of the technical key field
use_autoinc - 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

getModifyColumnStatement

String getModifyColumnStatement(String tablename,
                                ValueMetaInterface v,
                                String tk,
                                boolean use_autoinc,
                                String pk,
                                boolean semicolon)
Generates the SQL statement to modify a column in the specified table

Parameters:
tablename - The table to add
v - The column defined as a value
tk - the name of the technical key field
use_autoinc - 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 modify a column in the specified table

clone

Object clone()
Clone this database interface: copy all info to a new object

Returns:
the cloned Database Interface object.

getReservedWords

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

quoteReservedWords

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

getStartQuote

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

getEndQuote

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

supportsRepository

boolean supportsRepository()
Returns:
true if Kettle can create a repository on this type of database.

getTableTypes

String[] getTableTypes()
Returns:
a list of table types to retrieve tables for the database This is mostly just { "TABLE" }

getViewTypes

String[] getViewTypes()
Returns:
a list of table types to retrieve views for the database This is mostly just { "VIEW" }

getSynonymTypes

String[] getSynonymTypes()
Returns:
a list of table types to retrieve synonyms for the database

useSchemaNameForTableList

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

supportsViews

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

supportsSynonyms

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

getSQLListOfProcedures

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

getTruncateTableStatement

String getTruncateTableStatement(String tableName)
Parameters:
tableName - The table to be truncated.
Returns:
The SQL statement to truncate a table: remove all rows from it without a transaction

supportsFloatRoundingOnUpdate

boolean supportsFloatRoundingOnUpdate()
Returns:
true if the database rounds floating point numbers to the right precision. For example if the target field is number(7,2) the value 12.399999999 is converted into 12.40

getSQLLockTables

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

getSQLUnlockTables

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

supportsTimeStampToDateConversion

boolean supportsTimeStampToDateConversion()
Returns:
true if the database resultsets support getTimeStamp() to retrieve date-time. (Date)

supportsBatchUpdates

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

supportsBooleanDataType

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

setSupportsBooleanDataType

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

isDefaultingToUppercase

boolean isDefaultingToUppercase()
Returns:
true if the database defaults to naming tables and fields in upper case. True for most databases except for stuborn stuff like Postgres ;-)

getExtraOptions

Map<String,String> getExtraOptions()
Returns:
a map of all the extra URL options you want to set, retrieved from the attributes list (NOT synchronized!)

addExtraOption

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

getExtraOptionSeparator

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

getExtraOptionValueSeparator

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

getExtraOptionIndicator

String getExtraOptionIndicator()
Returns:
This indicator separates the normal URL from the options

supportsOptionsInURL

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

getExtraOptionsHelpText

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

supportsGetBlob

boolean supportsGetBlob()
Returns:
true if the database JDBC driver supports getBlob on the resultset. If not we must use getBytes() to get the data.

getConnectSQL

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

setConnectSQL

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

supportsSetMaxRows

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

isUsingConnectionPool

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

setUsingConnectionPool

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

getMaximumPoolSize

int getMaximumPoolSize()
Returns:
the maximum pool size

setMaximumPoolSize

void setMaximumPoolSize(int maximumPoolSize)
Parameters:
maximumPoolSize - the maximum pool size

getInitialPoolSize

int getInitialPoolSize()
Returns:
the initial pool size

setInitialPoolSize

void setInitialPoolSize(int initalPoolSize)
Parameters:
initalPoolSize - the initial pool size

isPartitioned

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

setPartitioned

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

getPartitioningInformation

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

setPartitioningInformation

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

getUsedLibraries

String[] getUsedLibraries()
Returns:
the required libraries (in libext) for this database connection.

getConnectionPoolingProperties

Properties getConnectionPoolingProperties()
Returns:
The set of properties that allows you to set the connection pooling parameters

setConnectionPoolingProperties

void setConnectionPoolingProperties(Properties properties)
set the connection pooling properties


getSQLTableExists

String getSQLTableExists(String tablename)
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

String getSQLColumnExists(String column,
                          String tablename)
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

boolean needsToLockAllTables()
Returns:
true if the database needs all repository tables to be locked, not just one ref table (R_REPOSITORY_LOG)

isStreamingResults

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

setStreamingResults

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

isQuoteAllFields

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

setQuoteAllFields

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

isForcingIdentifiersToLowerCase

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

setForcingIdentifiersToLowerCase

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

isForcingIdentifiersToUpperCase

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

setForcingIdentifiersToUpperCase

void setForcingIdentifiersToUpperCase(boolean forceUpperCase)
Parameters:
forceLowerCase - true if all identifiers should be forced to upper case

isUsingDoubleDecimalAsSchemaTableSeparator

boolean isUsingDoubleDecimalAsSchemaTableSeparator()
Returns:
true if we use a double decimal separator to specify schema/table combinations on MS-SQL server

setUsingDoubleDecimalAsSchemaTableSeparator

void setUsingDoubleDecimalAsSchemaTableSeparator(boolean useDoubleDecimalSeparator)
Parameters:
useDoubleDecimalSeparator - true if we should use a double decimal separator to specify schema/table combinations on MS-SQL server

isRequiringTransactionsOnQueries

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

getDatabaseFactoryName

String getDatabaseFactoryName()
You can use this method to supply an alternate factory for the test method in the dialogs. This is useful for plugins like SAP/R3 and PALO.

Returns:
the name of the database test factory to use.

getPreferredSchemaName

String getPreferredSchemaName()
Returns:
The preferred schema name of this database connection.

setPreferredSchemaName

void setPreferredSchemaName(String preferredSchemaName)
Parameters:
preferredSchemaName - The preferred schema name of this database connection.

checkIndexExists

boolean checkIndexExists(Database database,
                         String schemaName,
                         String tableName,
                         String[] idxFields)
                         throws KettleDatabaseException
Verifies on the specified database connection if an index exists on the fields with the specified name.

Parameters:
database -
schemaName -
tableName -
idxFields -
Returns:
Throws:
KettleDatabaseException

supportsSequenceNoMaxValueOption

boolean supportsSequenceNoMaxValueOption()
Returns:
true if the database supports sequences with a maximum value option. The default is true.

requiresCreateTablePrimaryKeyAppend

boolean requiresCreateTablePrimaryKeyAppend()
Returns:
true if we need to append the PRIMARY KEY block in the create table block after the fields, required for Caché.

requiresCastToVariousForIsNull

boolean requiresCastToVariousForIsNull()
Returns:
true if the database requires you to cast a parameter to varchar before comparing to null.

isDisplaySizeTwiceThePrecision

boolean isDisplaySizeTwiceThePrecision()
Returns:
Handles the special case of DB2 where the display size returned is twice the precision. In that case, the length is the precision.

supportsPreparedStatementMetadataRetrieval

boolean supportsPreparedStatementMetadataRetrieval()
Most databases allow you to retrieve result metadata by preparing a SELECT statement.

Returns:
true if the database supports retrieval of query metadata from a prepared statement. False if the query needs to be executed first.

isSystemTable

boolean isSystemTable(String tableName)
Parameters:
tableName -
Returns:
true if the specified table is a system table

supportsNewLinesInSQL

boolean supportsNewLinesInSQL()
Returns:
true if the database supports newlines in a SQL statements.

getSQLListOfSchemas

String getSQLListOfSchemas()
Returns:
the SQL to retrieve the list of schemas

getMaxColumnsInIndex

int getMaxColumnsInIndex()
Returns:
The maximum number of columns in a database, <=0 means: no known limit

supportsErrorHandlingOnBatchUpdates

boolean supportsErrorHandlingOnBatchUpdates()
Returns:
true if the database supports error handling (recovery of failure) while doing batch updates.

getSQLInsertAutoIncUnknownDimensionRow

String getSQLInsertAutoIncUnknownDimensionRow(String schemaTable,
                                              String keyField,
                                              String versionField)
Get the SQL to insert a new empty unknown record in a dimension.

Parameters:
schemaTable - the schema-table name to insert into
keyField - The key field
versionField - the version field
Returns:
the SQL to insert the unknown record into the SCD.

isExplorable

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

getXulOverlayFile

String getXulOverlayFile()
Returns:
The name of the XUL overlay file to display extra options. This is only used in case of a non-standard plugin. Usually this method returns null.

getSQLListOfSequences

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

quoteSQLString

String quoteSQLString(String string)
Parameters:
string -
Returns:
A string that is properly quoted for use in a SQL statement (insert, update, delete, etc)

getSelectCountStatement

String getSelectCountStatement(String tableName)
Returns the SQL Statement that counts the number of rows in the table.

Parameters:
tableName -
Returns:

generateColumnAlias

String generateColumnAlias(int columnIndex,
                           String suggestedName)
Generate a column alias given the column index and suggested name.

Parameters:
columnIndex - Index of column in query
suggestedName - Suggested column name
Returns:
Column alias that is valid for this database

parseStatements

List<String> parseStatements(String sqlScript)
Parse all possible statements from the provided SQL script.

Parameters:
sqlScript - Raw SQL Script to be parsed into executable statements.
Returns:
List of parsed SQL statements to be executed separately.

isMySQLVariant

boolean isMySQLVariant()
Returns:
true if the database is a MySQL variant, like MySQL 5.1, InfiniDB, InfoBright, and so on.

releaseSavepoint

boolean releaseSavepoint()
Returns a true of savepoints can be release, false if not.

Returns:

getNextBatchId

Long getNextBatchId(DatabaseMeta dbm,
                    Database ldb,
                    String schemaName,
                    String tableName,
                    String fieldName)
                    throws KettleDatabaseException
Get the next Batch ID from the logging tables.

Parameters:
dbm - DatabaseMeta object
ldb - Database connection
schemaName - Logging Schema Name
tableName - Logging Table Name
fieldName - Batch Id Field name
Returns:
next batch ID
Throws:
KettleDatabaseException

getDataTablespaceDDL

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.

Parameters:
VariableSpace - 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

String getIndexTablespaceDDL(VariableSpace variables,
                             DatabaseMeta databaseMeta)
Returns the tablespace DDL fragment for a "Index" tablespace.

Parameters:
VariableSpace - 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 indicis in the format "tablespace TABLESPACE_NAME". The TABLESPACE_NAME and the passed DatabaseMata determines if TABLESPACE_NAME is to be enclosed in quotes.

getValueFromResultSet

Object getValueFromResultSet(ResultSet resultSet,
                             ValueMetaInterface valueMeta,
                             int index)
                             throws KettleDatabaseException
This method allows a database dialect to convert database specific data types to Kettle data types.

Parameters:
resultSet - The result set to use
valueMeta - The description of the value to retrieve
index - the index on which we need to retrieve the value, 0-based.
Returns:
The correctly converted Kettle data type corresponding to the valueMeta description.
Throws:
KettleDatabaseException

useSafePoints

boolean useSafePoints()
Returns:
true if the database supports the use of safe-points and if it is appropriate to ever use it (default to false)

supportsErrorHandling

boolean supportsErrorHandling()
Returns:
true if the database supports error handling (the default). Returns false for certain databases (SQLite) that invalidate a prepared statement or even the complete connection when an error occurs.

supportsResultSetMetadataRetrievalOnly

boolean supportsResultSetMetadataRetrievalOnly()
Returns:
true if this database only supports metadata retrieval on a result set, never on a statement (even if the statement has been executed)