Class AbstractJdbcRowConverter
- java.lang.Object
-
- org.apache.flink.connector.jdbc.converter.AbstractJdbcRowConverter
-
- All Implemented Interfaces:
Serializable,JdbcRowConverter
- Direct Known Subclasses:
DerbyRowConverter,MySQLRowConverter,OracleRowConverter,PostgresRowConverter,SqlServerRowConverter
public abstract class AbstractJdbcRowConverter extends Object implements JdbcRowConverter
Base class for all converters that convert between JDBC object and Flink internal object.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAbstractJdbcRowConverter.JdbcDeserializationConverterRuntime converter to convert JDBC field toRowDatatype object.static interfaceAbstractJdbcRowConverter.JdbcSerializationConverterRuntime converter to convertRowDatafield to java object and fill into thePreparedStatement.
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.flink.table.types.logical.LogicalType[]fieldTypesprotected org.apache.flink.table.types.logical.RowTyperowTypeprotected AbstractJdbcRowConverter.JdbcSerializationConverter[]toExternalConvertersprotected AbstractJdbcRowConverter.JdbcDeserializationConverter[]toInternalConverters
-
Constructor Summary
Constructors Constructor Description AbstractJdbcRowConverter(org.apache.flink.table.types.logical.RowType rowType)
-
Method Summary
-
-
-
Field Detail
-
rowType
protected final org.apache.flink.table.types.logical.RowType rowType
-
toInternalConverters
protected final AbstractJdbcRowConverter.JdbcDeserializationConverter[] toInternalConverters
-
toExternalConverters
protected final AbstractJdbcRowConverter.JdbcSerializationConverter[] toExternalConverters
-
fieldTypes
protected final org.apache.flink.table.types.logical.LogicalType[] fieldTypes
-
-
Method Detail
-
converterName
public abstract String converterName()
-
toInternal
public org.apache.flink.table.data.RowData toInternal(ResultSet resultSet) throws SQLException
Description copied from interface:JdbcRowConverterConvert data retrieved fromResultSetto internalRowData.- Specified by:
toInternalin interfaceJdbcRowConverter- Parameters:
resultSet- ResultSet from JDBC- Throws:
SQLException
-
toExternal
public FieldNamedPreparedStatement toExternal(org.apache.flink.table.data.RowData rowData, FieldNamedPreparedStatement statement) throws SQLException
Description copied from interface:JdbcRowConverterConvert data retrieved from Flink internal RowData to JDBC Object.- Specified by:
toExternalin interfaceJdbcRowConverter- Parameters:
rowData- The given internalRowData.statement- The statement to be filled.- Returns:
- The filled statement.
- Throws:
SQLException
-
createNullableInternalConverter
protected AbstractJdbcRowConverter.JdbcDeserializationConverter createNullableInternalConverter(org.apache.flink.table.types.logical.LogicalType type)
Create a nullable runtimeAbstractJdbcRowConverter.JdbcDeserializationConverterfrom givenLogicalType.
-
wrapIntoNullableInternalConverter
protected AbstractJdbcRowConverter.JdbcDeserializationConverter wrapIntoNullableInternalConverter(AbstractJdbcRowConverter.JdbcDeserializationConverter jdbcDeserializationConverter)
-
createInternalConverter
protected AbstractJdbcRowConverter.JdbcDeserializationConverter createInternalConverter(org.apache.flink.table.types.logical.LogicalType type)
-
createNullableExternalConverter
protected AbstractJdbcRowConverter.JdbcSerializationConverter createNullableExternalConverter(org.apache.flink.table.types.logical.LogicalType type)
Create a nullable JDBC fAbstractJdbcRowConverter.JdbcSerializationConverterfrom given sql type.
-
wrapIntoNullableExternalConverter
protected AbstractJdbcRowConverter.JdbcSerializationConverter wrapIntoNullableExternalConverter(AbstractJdbcRowConverter.JdbcSerializationConverter jdbcSerializationConverter, org.apache.flink.table.types.logical.LogicalType type)
-
createExternalConverter
protected AbstractJdbcRowConverter.JdbcSerializationConverter createExternalConverter(org.apache.flink.table.types.logical.LogicalType type)
-
-