Class Db2DatabaseDialect
java.lang.Object
io.debezium.connector.jdbc.dialect.GeneralDatabaseDialect
io.debezium.connector.jdbc.dialect.db2.Db2DatabaseDialect
- All Implemented Interfaces:
DatabaseDialect
A
DatabaseDialect implementation for Db2.- Author:
- Chris Cranford
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDb2DatabaseDialect(JdbcSinkConnectorConfig config, org.hibernate.SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddColumnDefaultValue(SinkRecordDescriptor.FieldDescriptor field, StringBuilder columnSpec) Gets the field delimiter used when constructingALTER TABLEstatements.Gets the prefix used before adding each column-clause toALTER TABLEstatements.Gets the prefix used before adding column-clauses inALTER TABLEstatements.Gets the suffix used after adding the column-clauses inALTER TABLEstatements.Format a date and time.getFormattedTime(TemporalAccessor value) Format a time.Format a timestamp.Format a timestamp with time zone.intGets the maximum length of a nationalized VARCHAR field in a primary key column.intGets the maximum length of a VARCHAR field in a primary key column.private StringgetMergeDatClause(String fieldName, TableDescriptor table, SinkRecordDescriptor record) Construct aTRUNCATEstatement specific for this dialect.getUpsertStatement(TableDescriptor table, SinkRecordDescriptor record) Construct aUPSERTstatement specific for this dialect.protected booleanprotected voidprotected StringresolveColumnNameFromField(String fieldName) Methods inherited from class io.debezium.connector.jdbc.dialect.GeneralDatabaseDialect
bindValue, columnNameFromField, columnNameFromField, columnQueryBindingFromField, getAlterTableColumnSuffix, getAlterTableStatement, getByteArrayFormat, getColumnNamingStrategy, getConfig, getCreateTableStatement, getDatabaseTimeZone, getDatabaseTimeZoneQueryResult, getDatabaseVersion, getDefaultDecimalPrecision, getDefaultTimestampPrecision, getDeleteStatement, getFormattedBoolean, getFormattedDate, getFormattedDateTimeWithNanos, getFormattedTimeWithTimeZone, getIdentifierHelper, getInsertStatement, getMaxVarbinaryLength, getQualifiedTableName, getQueryBindingWithValueCast, getSchemaType, getTableId, getTypeName, getTypeName, getTypeName, getUpdateStatement, getVersion, isNegativeScaleAllowed, isTimeZoneSet, readTable, registerType, resolveColumnName, resolveMissingFields, shouldBindTimeWithTimeZoneAsDatabaseTimeZone, tableExists, toIdentifier, toIdentifierMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.connector.jdbc.dialect.DatabaseDialect
getMaxTimePrecision, getMaxTimestampPrecision, getTimeQueryBinding
-
Field Details
-
ISO_LOCAL_DATE_TIME_WITH_SPACE
-
-
Constructor Details
-
Db2DatabaseDialect
private Db2DatabaseDialect(JdbcSinkConnectorConfig config, org.hibernate.SessionFactory sessionFactory)
-
-
Method Details
-
getDatabaseTimeZoneQuery
- Overrides:
getDatabaseTimeZoneQueryin classGeneralDatabaseDialect
-
registerTypes
protected void registerTypes()- Overrides:
registerTypesin classGeneralDatabaseDialect
-
getMaxVarcharLengthInKey
public int getMaxVarcharLengthInKey()Description copied from interface:DatabaseDialectGets the maximum length of a VARCHAR field in a primary key column.- Specified by:
getMaxVarcharLengthInKeyin interfaceDatabaseDialect- Overrides:
getMaxVarcharLengthInKeyin classGeneralDatabaseDialect- Returns:
- maximum varchar field length when participating in the primary key
-
getMaxNVarcharLengthInKey
public int getMaxNVarcharLengthInKey()Description copied from interface:DatabaseDialectGets the maximum length of a nationalized VARCHAR field in a primary key column.- Specified by:
getMaxNVarcharLengthInKeyin interfaceDatabaseDialect- Overrides:
getMaxNVarcharLengthInKeyin classGeneralDatabaseDialect- Returns:
- maximum varchar field length when participating in the primary key
-
getAlterTablePrefix
Description copied from interface:DatabaseDialectGets the prefix used before adding column-clauses inALTER TABLEstatements.- Specified by:
getAlterTablePrefixin interfaceDatabaseDialect- Overrides:
getAlterTablePrefixin classGeneralDatabaseDialect- Returns:
- the alter table column-clauses prefix
-
getAlterTableSuffix
Description copied from interface:DatabaseDialectGets the suffix used after adding the column-clauses inALTER TABLEstatements.- Specified by:
getAlterTableSuffixin interfaceDatabaseDialect- Overrides:
getAlterTableSuffixin classGeneralDatabaseDialect- Returns:
- the alter table column-clauses suffix
-
getAlterTableColumnPrefix
Description copied from interface:DatabaseDialectGets the prefix used before adding each column-clause toALTER TABLEstatements.- Specified by:
getAlterTableColumnPrefixin interfaceDatabaseDialect- Overrides:
getAlterTableColumnPrefixin classGeneralDatabaseDialect- Returns:
- the alter table prefix just before each column-clause
-
getAlterTableColumnDelimiter
Description copied from interface:DatabaseDialectGets the field delimiter used when constructingALTER TABLEstatements.- Specified by:
getAlterTableColumnDelimiterin interfaceDatabaseDialect- Overrides:
getAlterTableColumnDelimiterin classGeneralDatabaseDialect- Returns:
- the field delimiter for alter table SQL statement
-
getUpsertStatement
Description copied from interface:DatabaseDialectConstruct aUPSERTstatement specific for this dialect.- Specified by:
getUpsertStatementin interfaceDatabaseDialect- Overrides:
getUpsertStatementin classGeneralDatabaseDialect- Parameters:
table- the current relational table model, should not benullrecord- the current sink record being processed, should not benull- Returns:
- the upsert SQL statement to be executed, never
null
-
getMergeDatClause
private String getMergeDatClause(String fieldName, TableDescriptor table, SinkRecordDescriptor record) -
addColumnDefaultValue
protected void addColumnDefaultValue(SinkRecordDescriptor.FieldDescriptor field, StringBuilder columnSpec) - Overrides:
addColumnDefaultValuein classGeneralDatabaseDialect
-
isIdentifierUppercaseWhenNotQuoted
protected boolean isIdentifierUppercaseWhenNotQuoted()- Overrides:
isIdentifierUppercaseWhenNotQuotedin classGeneralDatabaseDialect
-
getFormattedTime
Description copied from interface:DatabaseDialectFormat a time.- Specified by:
getFormattedTimein interfaceDatabaseDialect- Overrides:
getFormattedTimein classGeneralDatabaseDialect- Parameters:
value- the value to be formatted, nevernull- Returns:
- the formatted string value
-
getFormattedDateTime
Description copied from interface:DatabaseDialectFormat a date and time.- Specified by:
getFormattedDateTimein interfaceDatabaseDialect- Overrides:
getFormattedDateTimein classGeneralDatabaseDialect- Parameters:
value- the value to be formatted, nevernull- Returns:
- the formatted string value
-
getFormattedTimestamp
Description copied from interface:DatabaseDialectFormat a timestamp.- Specified by:
getFormattedTimestampin interfaceDatabaseDialect- Overrides:
getFormattedTimestampin classGeneralDatabaseDialect- Parameters:
value- the value to be formatted, nevernull- Returns:
- the formatted string value
-
getFormattedTimestampWithTimeZone
Description copied from interface:DatabaseDialectFormat a timestamp with time zone.- Specified by:
getFormattedTimestampWithTimeZonein interfaceDatabaseDialect- Overrides:
getFormattedTimestampWithTimeZonein classGeneralDatabaseDialect- Parameters:
value- the value to be formatted, nevernull- Returns:
- the formatted string value.
-
resolveColumnNameFromField
- Overrides:
resolveColumnNameFromFieldin classGeneralDatabaseDialect
-
getTruncateStatement
Description copied from interface:DatabaseDialectConstruct aTRUNCATEstatement specific for this dialect.- Specified by:
getTruncateStatementin interfaceDatabaseDialect- Overrides:
getTruncateStatementin classGeneralDatabaseDialect- Parameters:
table- the current relational table model, should not benull- Returns:
- the truncate SQL statement to be executed, never
null
-