public class DatabaseMeta extends SharedObjectBase implements Cloneable, XMLInterface, SharedObjectInterface, VariableSpace, RepositoryElementInterface
Modifier and Type | Field and Description |
---|---|
static int |
CLOB_LENGTH
Use this length in a String value to indicate that you want to use a CLOB in stead of a normal text field.
|
static Comparator<DatabaseMeta> |
comparator |
static String[] |
dbAccessTypeCode
Short description of the access type, used in XML and the repository.
|
static String[] |
dbAccessTypeDesc
Longer description for user interactions.
|
static String |
EMPTY_OPTIONS_STRING
The value to store in the attributes so that an empty value doesn't get lost...
|
static RepositoryObjectType |
REPOSITORY_ELEMENT_TYPE |
static int |
TYPE_ACCESS_JNDI
Connect to the database using JNDI.
|
static int |
TYPE_ACCESS_NATIVE
Connect natively through JDBC thin driver to the database.
|
static int |
TYPE_ACCESS_OCI
Connect to the database using OCI.
|
static int |
TYPE_ACCESS_ODBC
Connect to the database using ODBC.
|
static int |
TYPE_ACCESS_PLUGIN
Connect to the database using plugin specific method.
|
static int |
TYPE_DATABASE_ACCESS
Deprecated.
|
static int |
TYPE_DATABASE_AS400
Deprecated.
|
static int |
TYPE_DATABASE_CACHE
Deprecated.
|
static int |
TYPE_DATABASE_DB2
Deprecated.
|
static int |
TYPE_DATABASE_DBASE
Deprecated.
|
static int |
TYPE_DATABASE_DERBY
Deprecated.
|
static int |
TYPE_DATABASE_EXTENDB
Deprecated.
|
static int |
TYPE_DATABASE_FIREBIRD
Deprecated.
|
static int |
TYPE_DATABASE_GENERIC
Deprecated.
|
static int |
TYPE_DATABASE_GREENPLUM
Deprecated.
|
static int |
TYPE_DATABASE_GUPTA
Deprecated.
|
static int |
TYPE_DATABASE_H2
Deprecated.
|
static int |
TYPE_DATABASE_HYPERSONIC
Deprecated.
|
static int |
TYPE_DATABASE_INFOBRIGHT
Deprecated.
|
static int |
TYPE_DATABASE_INFORMIX
Deprecated.
|
static int |
TYPE_DATABASE_INGRES
Deprecated.
|
static int |
TYPE_DATABASE_INTERBASE
Deprecated.
|
static int |
TYPE_DATABASE_KINGBASEES
Deprecated.
|
static int |
TYPE_DATABASE_LUCIDDB
Deprecated.
|
static int |
TYPE_DATABASE_MONETDB
Deprecated.
|
static int |
TYPE_DATABASE_MSSQL
Deprecated.
|
static int |
TYPE_DATABASE_MYSQL
Deprecated.
|
static int |
TYPE_DATABASE_NEOVIEW
Deprecated.
|
static int |
TYPE_DATABASE_NETEZZA
Deprecated.
|
static int |
TYPE_DATABASE_NONE
Deprecated.
|
static int |
TYPE_DATABASE_ORACLE
Deprecated.
|
static int |
TYPE_DATABASE_ORACLE_RDB
Deprecated.
|
static int |
TYPE_DATABASE_PALO
Deprecated.
|
static int |
TYPE_DATABASE_POSTGRES
Deprecated.
|
static int |
TYPE_DATABASE_REMEDY_AR_SYSTEM
Deprecated.
|
static int |
TYPE_DATABASE_SAPDB
Deprecated.
|
static int |
TYPE_DATABASE_SAPR3
Deprecated.
|
static int |
TYPE_DATABASE_SQLITE
Deprecated.
|
static int |
TYPE_DATABASE_SYBASE
Deprecated.
|
static int |
TYPE_DATABASE_SYBASEIQ
Deprecated.
|
static int |
TYPE_DATABASE_TERADATA
Deprecated.
|
static int |
TYPE_DATABASE_UNIVERSE
Deprecated.
|
static int |
TYPE_DATABASE_VERTICA
Deprecated.
|
static String |
XML_TAG |
Constructor and Description |
---|
DatabaseMeta()
Create an empty database connection
|
DatabaseMeta(Node con)
Reads the information from an XML Node into this new database connection.
|
DatabaseMeta(String xml)
Constructs a new database using an XML string snippet.
|
DatabaseMeta(String name,
String type,
String access,
String host,
String db,
String port,
String user,
String pass)
Construct a new database connections.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtraOption(String databaseTypeCode,
String option,
String value)
Add an extra option to the attributes list
|
void |
addOptions()
Add a list of common options for some databases.
|
String[] |
checkParameters()
Check the database connection parameters and give back an array of remarks
|
void |
clearChanged() |
static void |
clearDatabaseInterfacesMap()
Clear the database interfaces map.
|
Object |
clone() |
void |
copyVariablesFrom(VariableSpace space)
Copy the variables from another space, without initializing with the defaults.
|
String |
environmentSubstitute(String aString)
Substitute the string using the current variable space.
|
String[] |
environmentSubstitute(String[] aString)
Replaces environment variables in an array of strings.
|
boolean |
equals(Object obj) |
String |
fieldSubstitute(String aString,
RowMetaInterface rowMeta,
Object[] rowData)
Substitutes field values in
aString . |
static DatabaseMeta |
findDatabase(List<? extends SharedObjectInterface> databases,
String dbname)
Find a database with a certain name in an arraylist of databases.
|
static DatabaseMeta |
findDatabase(List<DatabaseMeta> databases,
ObjectId id)
Find a database with a certain ID in an arraylist of databases.
|
String |
generateColumnAlias(int columnIndex,
String suggestedName) |
int |
getAccessType()
Return the type of database access.
|
static int |
getAccessType(String dbaccess) |
String |
getAccessTypeDesc()
Gets you a short description of the type of database access.
|
static String |
getAccessTypeDesc(int dbaccess) |
static String |
getAccessTypeDescLong(int dbaccess) |
static int[] |
getAccessTypeList(String dbTypeDesc) |
String |
getAddColumnStatement(String tablename,
ValueMetaInterface v,
String tk,
boolean use_autoinc,
String pk,
boolean semicolon) |
Properties |
getAttributes() |
boolean |
getBooleanValueOfVariable(String variableName,
boolean defaultValue)
This method returns a boolean for the new variable check boxes.
|
Properties |
getConnectionPoolingProperties() |
Properties |
getConnectionProperties() |
String |
getConnectSQL() |
DatabaseFactoryInterface |
getDatabaseFactory() |
DatabaseInterface |
getDatabaseInterface() |
static DatabaseInterface |
getDatabaseInterface(String databaseType)
Search for the right type of DatabaseInterface object and clone it.
|
static DatabaseInterface[] |
getDatabaseInterfaces() |
static Map<String,DatabaseInterface> |
getDatabaseInterfacesMap() |
String |
getDatabaseName()
Return the name of the database.
|
String |
getDatabasePortNumberString()
Return the port on which the database listens as a String.
|
String |
getDatabaseTypeDesc()
Deprecated.
This is actually the plugin ID
|
String |
getDataTablespace() |
int |
getDefaultDatabasePort() |
String |
getDescription()
Gets the description of the repository object.
|
String |
getDisplayName()
Returns the name of the database connection
|
String |
getDriverClass() |
String |
getDropColumnStatement(String tablename,
ValueMetaInterface v,
String tk,
boolean use_autoinc,
String pk,
boolean semicolon) |
String |
getEndQuote() |
String |
getExtraOptionIndicator() |
Map<String,String> |
getExtraOptions() |
String |
getExtraOptionSeparator() |
String |
getExtraOptionsHelpText() |
String |
getExtraOptionValueSeparator() |
List<RowMetaAndData> |
getFeatureSummary() |
String |
getFieldDefinition(ValueMetaInterface v,
String tk,
String pk,
boolean use_autoinc) |
String |
getFieldDefinition(ValueMetaInterface v,
String tk,
String pk,
boolean use_autoinc,
boolean add_fieldname,
boolean add_cr) |
String |
getFunctionAverage() |
String |
getFunctionCount() |
String |
getFunctionMaximum() |
String |
getFunctionMinimum() |
String |
getFunctionSum() |
String |
getHostname()
Return the hostname of the machine on which the database runs.
|
String |
getIndexTablespace() |
int |
getInitialPoolSize() |
String |
getLimitClause(int nrRows) |
int |
getMaxColumnsInIndex() |
int |
getMaximumPoolSize() |
int |
getMaxTextFieldLength()
Get the maximum length of a text field for this database connection.
|
String |
getModifyColumnStatement(String tablename,
ValueMetaInterface v,
String tk,
boolean use_autoinc,
String pk,
boolean semicolon) |
String |
getName()
Returns the name of the database connection
|
Long |
getNextBatchId(Database ldb,
String schemaName,
String tableName,
String fieldName) |
int |
getNotFoundTK(boolean use_autoinc) |
int |
getNrReservedWords(RowMetaInterface fields)
Checks the fields specified for reserved words
|
ObjectId |
getObjectId()
Returns the database ID of this database connection if a repository was used before.
|
ObjectRevision |
getObjectRevision()
Gets the object revision.
|
VariableSpace |
getParentVariableSpace()
Get the parent of the variable space.
|
PartitionDatabaseMeta[] |
getPartitioningInformation() |
PartitionDatabaseMeta |
getPartitionMeta(String partitionId)
Finds the partition metadata for the given partition iD
|
String |
getPassword()
Get the password to log into the database on this connection.
|
String |
getPluginId()
The plugin ID of the database interface
|
static int |
getPortForDBType(String strtype,
String straccess) |
String |
getPreferredSchemaName() |
String |
getQuotedSchemaTableCombination(String schemaName,
String tableName)
Calculate the schema-table combination, usually this is the schema and table separated with a dot.
|
RepositoryDirectoryInterface |
getRepositoryDirectory()
Not used in this case, simply return root /
|
RepositoryObjectType |
getRepositoryElementType()
Gets the repository element type for this object.
|
String[] |
getReservedWords() |
String |
getSchemaTableCombination(String schemaName,
String tableName)
Deprecated.
please use getQuotedSchemaTableCombination()
|
String |
getSeqNextvalSQL(String sequenceName) |
String |
getServername() |
String |
getSQLColumnExists(String columnname,
String tablename) |
String |
getSQLCurrentSequenceValue(String sequenceName) |
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 |
getSQLQueryFields(String tableName) |
String |
getSQLSequenceExists(String sequenceName) |
String |
getSQLServerInstance() |
String |
getSQLTableExists(String tablename) |
String |
getSQLUnlockTables(String[] tableNames) |
String |
getStartQuote() |
String[] |
getSynonymTypes() |
String[] |
getTableTypes() |
String |
getTruncateTableStatement(String schema,
String tableName) |
String |
getURL() |
String |
getURL(String partitionId) |
String |
getUsername()
Get the username to log into the database on this connection.
|
Object |
getValueFromResultSet(ResultSet rs,
ValueMetaInterface val,
int i) |
String |
getVariable(String variableName)
Get the value of a variable.
|
String |
getVariable(String variableName,
String defaultValue)
Get the value of a variable with a default in case the variable is not found.
|
String[] |
getViewTypes() |
String |
getXML()
Describes the Object implementing this interface as XML
|
boolean |
hasChanged() |
boolean |
hasDotInField(String fieldname) |
int |
hashCode() |
boolean |
hasSpacesInField(String fieldname)
Detects if a field has spaces in the name.
|
boolean |
hasSpecialCharInField(String fieldname)
Detects if a field has spaces in the name.
|
void |
initializeVariablesFrom(VariableSpace parent)
Initialize variable space using the defaults, copy over the variables from the parent (using copyVariablesFrom()),
after this the "injected" variables should be inserted (injectVariables()).
|
void |
injectVariables(Map<String,String> prop)
Inject variables.
|
boolean |
isClob(ValueMetaInterface v) |
boolean |
isDisplaySizeTwiceThePrecision() |
boolean |
isExplorable() |
boolean |
isFetchSizeSupported() |
boolean |
isForcingIdentifiersToLowerCase() |
boolean |
isForcingIdentifiersToUpperCase() |
boolean |
isInNeedOfQuoting(String fieldname)
Determines whether or not this field is in need of quoting:
- When the fieldname contains spaces - When the fieldname is a reserved word |
boolean |
isMySQLVariant() |
boolean |
isPartitioned() |
boolean |
isQuoteAllFields() |
boolean |
isReadOnly()
Marker used to determine if the DatabaseMeta should be allowed to be modified/saved.
|
boolean |
isRequiringTransactionsOnQueries() |
boolean |
isReservedWord(String word)
Returns true if the string specified is a reserved word on this database type.
|
boolean |
isStreamingResults() |
boolean |
isSystemTable(String tableName) |
boolean |
isUsingConnectionPool() |
boolean |
isUsingDoubleDecimalAsSchemaTableSeparator() |
String[] |
listVariables()
List the variables (not the values) that are currently in the variable space.
|
boolean |
needsPlaceHolder()
Indicates the need to insert a placeholder (0) for auto increment fields.
|
boolean |
needsToLockAllTables() |
boolean |
preserveReservedCase() |
String |
quoteField(String field)
Returns a quoted field if this is needed: contains spaces, is a reserved word, ...
|
boolean |
quoteReservedWords() |
void |
quoteReservedWords(RowMetaInterface fields)
Changes the names of the fields to their quoted equivalent if this is needed
|
String |
quoteSQLString(String string) |
void |
replaceMeta(DatabaseMeta databaseMeta) |
boolean |
replaceReservedWords(RowMetaInterface fields)
Checks the fields specified for reserved words and quotes them.
|
boolean |
requiresCastToVariousForIsNull() |
boolean |
requiresCreateTablePrimaryKeyAppend() |
void |
setAccessType(int access_type)
Set the type of database access.
|
void |
setAttributes(Properties attributes)
Set extra attributes on this database connection
|
void |
setChanged() |
void |
setChanged(boolean ch) |
void |
setConnectionPoolingProperties(Properties properties) |
void |
setConnectSQL(String sql) |
void |
setDatabaseInterface(DatabaseInterface databaseInterface)
Set the system dependend database interface for this database metadata definition
|
void |
setDatabaseType(String type) |
void |
setDataTablespace(String data_tablespace) |
void |
setDBName(String databaseName)
Set the name of the database.
|
void |
setDBPort(String db_port)
Sets the port on which the database listens.
|
void |
setDefault()
Set default values for an Oracle database.
|
void |
setDescription(String description)
Sets the description of the repository object.
|
void |
setDisplayName(String displayName) |
void |
setForcingIdentifiersToLowerCase(boolean forceLowerCase) |
void |
setForcingIdentifiersToUpperCase(boolean forceUpperCase) |
void |
setHostname(String hostname)
Sets the hostname of the machine on which the database runs.
|
void |
setIndexTablespace(String index_tablespace) |
void |
setInitialPoolSize(int initalPoolSize) |
void |
setMaximumPoolSize(int maximumPoolSize) |
void |
setName(String name)
Sets the name of the database connection.
|
void |
setObjectId(ObjectId id)
Sets the database ID in the repository for this object.
|
void |
setObjectRevision(ObjectRevision objectRevision)
Sets the object revision.
|
void |
setParentVariableSpace(VariableSpace parent)
Set the parent variable space
|
void |
setPartitioned(boolean partitioned) |
void |
setPartitioningInformation(PartitionDatabaseMeta[] partitionInfo) |
void |
setPassword(String password)
Sets the password to log into the database on this connection.
|
void |
setPreferredSchemaName(String preferredSchemaName) |
void |
setPreserveReservedCase(boolean b) |
void |
setQuoteAllFields(boolean quoteAllFields) |
void |
setReadOnly(boolean readOnly)
Sets the marker used to determine if the DatabaseMeta should be allowed to be modified/saved.
|
void |
setRepositoryDirectory(RepositoryDirectoryInterface repositoryDirectory) |
void |
setServername(String servername) |
void |
setSQLServerInstance(String instanceName) |
void |
setStreamingResults(boolean useStreaming) |
void |
setSupportsBooleanDataType(boolean b) |
void |
setSupportsTimestampDataType(boolean b) |
void |
setUsername(String username)
Sets the username to log into the database on this connection.
|
void |
setUsingConnectionPool(boolean usePool) |
void |
setUsingDoubleDecimalAsSchemaTableSeparator(boolean useDoubleDecimalSeparator) |
void |
setValues(DatabaseMeta info) |
void |
setValues(String name,
String type,
String access,
String host,
String db,
String port,
String user,
String pass) |
void |
setVariable(String variableName,
String variableValue)
Sets a variable in the Kettle Variables list.
|
void |
shareVariablesWith(VariableSpace space)
Share a variable space from another variable space.
|
String |
stripCR(String sbsql) |
String |
stripCR(StringBuffer sbsql) |
boolean |
supportsAutoinc() |
boolean |
supportsBatchUpdates() |
boolean |
supportsBitmapIndex() |
boolean |
supportsBooleanDataType() |
boolean |
supportsCatalogs() |
boolean |
supportsEmptyTransactions() |
boolean |
supportsErrorHandlingOnBatchUpdates() |
boolean |
supportsFloatRoundingOnUpdate() |
boolean |
supportsGetBlob() |
boolean |
supportsOptionsInURL() |
boolean |
supportsPreparedStatementMetadataRetrieval() |
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 |
supportsTimestampDataType() |
boolean |
supportsTimeStampToDateConversion() |
boolean |
supportsTransactions()
Deprecated.
because the same database can support transactions or not. It all depends on the database setup.
Therefor, we look at the database metadata DatabaseMetaData.supportsTransactions() in stead of this.
|
boolean |
supportsViews() |
String |
testConnection() |
String |
toString() |
boolean |
useSchemaNameForTableList() |
String |
verifyAndModifyDatabaseName(List<DatabaseMeta> databases,
String oldname)
Verify the name of the database and if required, change it if it already exists in the list of databases.
|
getChangedDate, isShared, setChangedDate, setShared
getChangedDate, isShared, setShared
public static final String XML_TAG
public static final RepositoryObjectType REPOSITORY_ELEMENT_TYPE
public static final Comparator<DatabaseMeta> comparator
@Deprecated public static final int TYPE_DATABASE_NONE
@Deprecated public static final int TYPE_DATABASE_MYSQL
@Deprecated public static final int TYPE_DATABASE_ORACLE
@Deprecated public static final int TYPE_DATABASE_AS400
@Deprecated public static final int TYPE_DATABASE_ACCESS
@Deprecated public static final int TYPE_DATABASE_MSSQL
@Deprecated public static final int TYPE_DATABASE_DB2
@Deprecated public static final int TYPE_DATABASE_POSTGRES
@Deprecated public static final int TYPE_DATABASE_CACHE
@Deprecated public static final int TYPE_DATABASE_INFORMIX
@Deprecated public static final int TYPE_DATABASE_SYBASE
@Deprecated public static final int TYPE_DATABASE_GUPTA
@Deprecated public static final int TYPE_DATABASE_DBASE
@Deprecated public static final int TYPE_DATABASE_FIREBIRD
@Deprecated public static final int TYPE_DATABASE_SAPDB
@Deprecated public static final int TYPE_DATABASE_HYPERSONIC
@Deprecated public static final int TYPE_DATABASE_GENERIC
@Deprecated public static final int TYPE_DATABASE_SAPR3
@Deprecated public static final int TYPE_DATABASE_INGRES
@Deprecated public static final int TYPE_DATABASE_INTERBASE
@Deprecated public static final int TYPE_DATABASE_EXTENDB
@Deprecated public static final int TYPE_DATABASE_TERADATA
@Deprecated public static final int TYPE_DATABASE_ORACLE_RDB
@Deprecated public static final int TYPE_DATABASE_H2
@Deprecated public static final int TYPE_DATABASE_NETEZZA
@Deprecated public static final int TYPE_DATABASE_UNIVERSE
@Deprecated public static final int TYPE_DATABASE_SQLITE
@Deprecated public static final int TYPE_DATABASE_DERBY
@Deprecated public static final int TYPE_DATABASE_REMEDY_AR_SYSTEM
@Deprecated public static final int TYPE_DATABASE_PALO
@Deprecated public static final int TYPE_DATABASE_SYBASEIQ
@Deprecated public static final int TYPE_DATABASE_GREENPLUM
@Deprecated public static final int TYPE_DATABASE_MONETDB
@Deprecated public static final int TYPE_DATABASE_KINGBASEES
@Deprecated public static final int TYPE_DATABASE_VERTICA
@Deprecated public static final int TYPE_DATABASE_NEOVIEW
@Deprecated public static final int TYPE_DATABASE_LUCIDDB
@Deprecated public static final int TYPE_DATABASE_INFOBRIGHT
public static final int TYPE_ACCESS_NATIVE
public static final int TYPE_ACCESS_ODBC
public static final int TYPE_ACCESS_OCI
public static final int TYPE_ACCESS_PLUGIN
public static final int TYPE_ACCESS_JNDI
public static final String[] dbAccessTypeCode
public static final String[] dbAccessTypeDesc
public static final int CLOB_LENGTH
public static final String EMPTY_OPTIONS_STRING
public DatabaseMeta(String name, String type, String access, String host, String db, String port, String user, String pass)
name
- The database nametype
- The type of databaseaccess
- The type of database accesshost
- The hostname or IP addressdb
- The database nameport
- The port on which the database listens.user
- The usernamepass
- The passwordpublic DatabaseMeta()
public DatabaseMeta(String xml) throws KettleXMLException
connection
tags.xml
- The XML string to parseKettleXMLException
- in case there is an XML parsing errorpublic DatabaseMeta(Node con) throws KettleXMLException
con
- The Node to read the data fromKettleXMLException
public void setDefault()
public void addOptions()
public DatabaseInterface getDatabaseInterface()
public void setDatabaseInterface(DatabaseInterface databaseInterface)
databaseInterface
- the system dependend database interfacepublic static final DatabaseInterface getDatabaseInterface(String databaseType) throws KettleDatabaseException
databaseType
- the type of DatabaseInterface to look for (description)KettleDatabaseException
- when the type could not be found or referenced.public ObjectId getObjectId()
getObjectId
in interface RepositoryElementInterface
getObjectId
in interface RepositoryObjectInterface
public void setObjectId(ObjectId id)
RepositoryElementInterface
setObjectId
in interface RepositoryElementInterface
public void replaceMeta(DatabaseMeta databaseMeta)
public void setValues(String name, String type, String access, String host, String db, String port, String user, String pass)
public void setDatabaseType(String type)
public void setValues(DatabaseMeta info)
public void setName(String name)
setName
in interface RepositoryElementInterface
name
- The name of the database connectionpublic String getName()
getName
in interface RepositoryElementInterface
getName
in interface RepositoryObjectInterface
getName
in interface SharedObjectInterface
public void setDisplayName(String displayName)
public String getDisplayName()
public String getPluginId()
public int getAccessType()
TYPE_ACCESS_NATIVE
TYPE_ACCESS_ODBC
TYPE_ACCESS_OCI
public void setAccessType(int access_type)
access_type
- The access type.@Deprecated public String getDatabaseTypeDesc()
public String getAccessTypeDesc()
public String getHostname()
public void setHostname(String hostname)
hostname
- The hostname of the machine on which the database runs.public String getDatabasePortNumberString()
public void setDBPort(String db_port)
db_port
- The port number on which the database listenspublic String getDatabaseName()
public void setDBName(String databaseName)
databaseName
- The new name of the databasepublic String getUsername()
public void setUsername(String username)
username
- The usernamepublic String getPassword()
public void setPassword(String password)
password
- the password to log into the database on this connection.public void setServername(String servername)
servername
- the Informix servernamepublic String getServername()
public String getDataTablespace()
public void setDataTablespace(String data_tablespace)
public String getIndexTablespace()
public void setIndexTablespace(String index_tablespace)
public void setChanged()
public void setChanged(boolean ch)
public boolean hasChanged()
public void clearChanged()
public Properties getAttributes()
public void setAttributes(Properties attributes)
attributes
- The extra attributes to set on this database connection.public String getXML()
XMLInterface
getXML
in interface XMLInterface
getXML
in interface SharedObjectInterface
public String getURL() throws KettleDatabaseException
KettleDatabaseException
public String getURL(String partitionId) throws KettleDatabaseException
KettleDatabaseException
public Properties getConnectionProperties()
public String getExtraOptionIndicator()
public String getExtraOptionSeparator()
public String getExtraOptionValueSeparator()
public void addExtraOption(String databaseTypeCode, String option, String value)
databaseTypeCode
- The database type code for which the option appliesoption
- The option to setvalue
- The value of the option@Deprecated public boolean supportsTransactions()
public boolean supportsAutoinc()
public boolean supportsSequences()
public boolean supportsBitmapIndex()
public boolean supportsSetLong()
public boolean supportsSchemas()
public boolean supportsCatalogs()
public boolean supportsEmptyTransactions()
public boolean supportsSetCharacterStream()
public int getMaxTextFieldLength()
public static final int getAccessType(String dbaccess)
public static final String getAccessTypeDesc(int dbaccess)
public static final String getAccessTypeDescLong(int dbaccess)
public static final DatabaseInterface[] getDatabaseInterfaces()
public static final void clearDatabaseInterfacesMap()
public static final Map<String,DatabaseInterface> getDatabaseInterfacesMap()
public static final int[] getAccessTypeList(String dbTypeDesc)
public int getDefaultDatabasePort()
public int getNotFoundTK(boolean use_autoinc)
public String getDriverClass()
public String stripCR(StringBuffer sbsql)
public boolean isFetchSizeSupported()
public boolean needsPlaceHolder()
public String getFunctionSum()
public String getFunctionAverage()
public String getFunctionMaximum()
public String getFunctionMinimum()
public String getFunctionCount()
public String[] checkParameters()
@Deprecated public String getSchemaTableCombination(String schemaName, String tableName)
schemaName
- tableName
- public String getQuotedSchemaTableCombination(String schemaName, String tableName)
schemaName
- the schema-name or null if no schema is used.tableName
- the table namepublic boolean isClob(ValueMetaInterface v)
public String getFieldDefinition(ValueMetaInterface v, String tk, String pk, boolean use_autoinc)
public String getFieldDefinition(ValueMetaInterface v, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr)
public String getLimitClause(int nrRows)
public String getSQLQueryFields(String tableName)
tableName
- The table or schema-table combination. We expect this to be quoted properly already!public String getAddColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon)
public String getDropColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon)
public String getModifyColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon)
public String[] getReservedWords()
public boolean quoteReservedWords()
public String getStartQuote()
public String getEndQuote()
public String quoteField(String field)
field
- The fieldname to check for quotingpublic boolean isInNeedOfQuoting(String fieldname)
fieldname
- the fieldname to check if there is a need for quotingpublic boolean isReservedWord(String word)
word
- The word to checkpublic boolean hasSpacesInField(String fieldname)
fieldname
- The fieldname to check for spacespublic boolean hasSpecialCharInField(String fieldname)
fieldname
- The fieldname to check for spacespublic boolean hasDotInField(String fieldname)
public boolean replaceReservedWords(RowMetaInterface fields)
fields
- the list of fields to checkpublic int getNrReservedWords(RowMetaInterface fields)
fields
- the list of fields to checkpublic String[] getTableTypes()
public String[] getViewTypes()
public String[] getSynonymTypes()
public boolean useSchemaNameForTableList()
public boolean supportsViews()
public boolean supportsSynonyms()
public String getSQLListOfProcedures()
public String getTruncateTableStatement(String schema, String tableName)
tableName
- The tablename to be truncatedpublic boolean supportsFloatRoundingOnUpdate()
public String getSQLLockTables(String[] tableNames)
tableNames
- The names of the tables to lockpublic String getSQLUnlockTables(String[] tableNames)
tableNames
- The names of the tables to unlockpublic List<RowMetaAndData> getFeatureSummary()
public boolean supportsTimeStampToDateConversion()
public boolean supportsBatchUpdates()
public boolean supportsBooleanDataType()
public void setSupportsBooleanDataType(boolean b)
b
- Set to true if the database supports a boolean, bit, logical, ... datatypepublic boolean supportsTimestampDataType()
public void setSupportsTimestampDataType(boolean b)
b
- Set to true if the database supports the Timestamp data type (nanosecond precision and all)public boolean preserveReservedCase()
public void setPreserveReservedCase(boolean b)
public void quoteReservedWords(RowMetaInterface fields)
fields
- The row of fields to changepublic Map<String,String> getExtraOptions()
public boolean supportsOptionsInURL()
public String getExtraOptionsHelpText()
public boolean supportsGetBlob()
public String getConnectSQL()
public void setConnectSQL(String sql)
sql
- The SQL to execute right after connectingpublic boolean supportsSetMaxRows()
public String verifyAndModifyDatabaseName(List<DatabaseMeta> databases, String oldname)
databases
- the databases to check against.oldname
- the old name of the databasepublic boolean isUsingConnectionPool()
public void setUsingConnectionPool(boolean usePool)
usePool
- true if we want to use a database connection poolpublic int getMaximumPoolSize()
public void setMaximumPoolSize(int maximumPoolSize)
maximumPoolSize
- the maximum pool sizepublic int getInitialPoolSize()
public void setInitialPoolSize(int initalPoolSize)
initalPoolSize
- the initial pool sizepublic boolean isPartitioned()
public void setPartitioned(boolean partitioned)
partitioned
- true if the connection is set to contain partitioning informationpublic PartitionDatabaseMeta[] getPartitioningInformation()
public void setPartitioningInformation(PartitionDatabaseMeta[] partitionInfo)
partitionInfo
- the available partition/host/databases/port combinations in the clusterpublic PartitionDatabaseMeta getPartitionMeta(String partitionId)
partitionId
- The partition ID to look forpublic Properties getConnectionPoolingProperties()
public void setConnectionPoolingProperties(Properties properties)
public boolean needsToLockAllTables()
public boolean isStreamingResults()
public void setStreamingResults(boolean useStreaming)
useStreaming
- true if we want the database to stream results (normally this is an option just for MySQL).public boolean isQuoteAllFields()
public void setQuoteAllFields(boolean quoteAllFields)
quoteAllFields
- true if all fields in DB should be quoted.public boolean isForcingIdentifiersToLowerCase()
public void setForcingIdentifiersToLowerCase(boolean forceLowerCase)
forceLowerCase
- true if all identifiers should be forced to lower casepublic boolean isForcingIdentifiersToUpperCase()
public void setForcingIdentifiersToUpperCase(boolean forceUpperCase)
forceUpperCase
- true if all identifiers should be forced to upper casepublic static final DatabaseMeta findDatabase(List<? extends SharedObjectInterface> databases, String dbname)
databases
- The ArrayList of databasesdbname
- The name of the database connectionpublic static final DatabaseMeta findDatabase(List<DatabaseMeta> databases, ObjectId id)
databases
- The ArrayList of databasesid
- The id of the database connectionpublic void copyVariablesFrom(VariableSpace space)
VariableSpace
copyVariablesFrom
in interface VariableSpace
space
- the space to copy the variables from.public String environmentSubstitute(String aString)
VariableSpace
environmentSubstitute
in interface VariableSpace
aString
- The string to substitute.public String[] environmentSubstitute(String[] aString)
VariableSpace
environmentSubstitute
in interface VariableSpace
aString
- The array of strings that wants its variables to be replaced.public String fieldSubstitute(String aString, RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException
VariableSpace
aString
. Field values are of the form "?{fieldSubstitute
in interface VariableSpace
aString
- the string on which to apply the substitution.rowMeta
- The row metadata to use.rowData
- The row data to useKettleValueException
- In case there is a String conversion errorpublic VariableSpace getParentVariableSpace()
VariableSpace
getParentVariableSpace
in interface VariableSpace
public void setParentVariableSpace(VariableSpace parent)
VariableSpace
setParentVariableSpace
in interface VariableSpace
parent
- The parent variable space to setpublic String getVariable(String variableName, String defaultValue)
VariableSpace
getVariable
in interface VariableSpace
variableName
- The name of the variabledefaultValue
- The default value in case the variable could not be foundpublic String getVariable(String variableName)
VariableSpace
getVariable
in interface VariableSpace
variableName
- The name of the variablepublic boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
VariableSpace
getBooleanValueOfVariable
in interface VariableSpace
variableName
- The variable to look up.defaultValue
- The default value to return.static method ValueMeta.convertStringToBoolean()
public void initializeVariablesFrom(VariableSpace parent)
VariableSpace
initializeVariablesFrom
in interface VariableSpace
parent
- the parent to start from, or null if root.public String[] listVariables()
VariableSpace
listVariables
in interface VariableSpace
public void setVariable(String variableName, String variableValue)
VariableSpace
setVariable
in interface VariableSpace
variableName
- The name of the variable to setvariableValue
- The value of the variable to set. If the variableValue is null, the variable is cleared from the list.public void shareVariablesWith(VariableSpace space)
VariableSpace
shareVariablesWith
in interface VariableSpace
space
- Variable space to be shared.public void injectVariables(Map<String,String> prop)
VariableSpace
injectVariables
in interface VariableSpace
prop
- Properties object containing key-value pairs.public String getSQLServerInstance()
public void setSQLServerInstance(String instanceName)
instanceName
- the SQL Server instancepublic boolean isUsingDoubleDecimalAsSchemaTableSeparator()
public void setUsingDoubleDecimalAsSchemaTableSeparator(boolean useDoubleDecimalSeparator)
useDoubleDecimalSeparator
- true if we want the database to stream results (normally this is an option just for MySQL).public boolean isRequiringTransactionsOnQueries()
public String testConnection()
public DatabaseFactoryInterface getDatabaseFactory() throws Exception
Exception
public String getPreferredSchemaName()
public void setPreferredSchemaName(String preferredSchemaName)
public RepositoryDirectoryInterface getRepositoryDirectory()
getRepositoryDirectory
in interface RepositoryElementInterface
public void setRepositoryDirectory(RepositoryDirectoryInterface repositoryDirectory)
setRepositoryDirectory
in interface RepositoryElementInterface
public RepositoryObjectType getRepositoryElementType()
RepositoryElementInterface
getRepositoryElementType
in interface RepositoryElementInterface
public ObjectRevision getObjectRevision()
RepositoryElementInterface
getObjectRevision
in interface RepositoryElementInterface
public void setObjectRevision(ObjectRevision objectRevision)
RepositoryElementInterface
setObjectRevision
in interface RepositoryElementInterface
public String getDescription()
RepositoryElementInterface
getDescription
in interface RepositoryElementInterface
public void setDescription(String description)
RepositoryElementInterface
setDescription
in interface RepositoryElementInterface
public boolean supportsSequenceNoMaxValueOption()
public boolean requiresCreateTablePrimaryKeyAppend()
public boolean requiresCastToVariousForIsNull()
public boolean isDisplaySizeTwiceThePrecision()
public boolean supportsPreparedStatementMetadataRetrieval()
public boolean isSystemTable(String tableName)
public String getSQLListOfSchemas()
public int getMaxColumnsInIndex()
public boolean supportsErrorHandlingOnBatchUpdates()
public String getSQLInsertAutoIncUnknownDimensionRow(String schemaTable, String keyField, String versionField)
schemaTable
- the schema-table name to insert intokeyField
- The key fieldversionField
- the version fieldpublic boolean isExplorable()
public String getSQLListOfSequences()
public boolean isMySQLVariant()
public Long getNextBatchId(Database ldb, String schemaName, String tableName, String fieldName) throws KettleDatabaseException
KettleDatabaseException
public Object getValueFromResultSet(ResultSet rs, ValueMetaInterface val, int i) throws KettleDatabaseException
KettleDatabaseException
public boolean isReadOnly()
public void setReadOnly(boolean readOnly)