Package com.illumon.iris.utils
Class JdbcTypeMapper.IntDataTypeMapping
java.lang.Object
com.illumon.iris.utils.JdbcTypeMapper.DataTypeMapping<Integer>
com.illumon.iris.utils.JdbcTypeMapper.IntDataTypeMapping
- Enclosing class:
- JdbcTypeMapper
public static class JdbcTypeMapper.IntDataTypeMapping
extends JdbcTypeMapper.DataTypeMapping<Integer>
-
Method Summary
Modifier and TypeMethodDescriptionvoidbindInt(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, int value) Bind the given integer to the given prepared statement.voidbindObject(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, Integer value) Bind the given value to the given prepared statement.columnSourceBinder(ColumnSource columnSource, JdbcTypeMapper.Context context) Provides a function, via a lambda, that can be used to bind values from the given ColumnSource to a PreparedStatement.columnSourcePrevBinder(ColumnSource columnSource, JdbcTypeMapper.Context context) Provides a function, via a lambda, that can be used to bind previous values from the given ColumnSource to a PreparedStatement.intgetInt(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, int defaultValue) Get an int value from the current row in the given ResultSet and column and convert to the target type.getObject(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, Integer defaultValue) Get a value from the current row in the given ResultSet and column and convert to the target type.Methods inherited from class com.illumon.iris.utils.JdbcTypeMapper.DataTypeMapping
bindByte, bindChar, bindDouble, bindFloat, bindLong, bindShort, getByte, getByte, getChar, getChar, getDbType, getDouble, getDouble, getFloat, getFloat, getInputType, getInt, getLong, getLong, getObject, getObject, getObject, getObjectCodec, getObjectCodecArguments, getObjectCodecArguments, getShort, getShort
-
Method Details
-
getInt
public int getInt(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, int defaultValue) throws SQLException Description copied from class:JdbcTypeMapper.DataTypeMappingGet an int value from the current row in the given ResultSet and column and convert to the target type. If the source value is null, return the given default value. A Context object is provided for additional context or "settings" regarding how to perform the conversion (for example, the source time zone). Only mappings that can logically be converted to an int need implement this method.- Overrides:
getIntin classJdbcTypeMapper.DataTypeMapping<Integer>- Parameters:
resultSet- from which to extract the value.columnIndex- ResultSet column from which to extract the value (1-based).context- conversion context information.defaultValue- value to return in case the source value is null.- Returns:
- the converted value
- Throws:
SQLException- if an error occurs
-
getObject
public Integer getObject(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, Integer defaultValue) throws SQLException Description copied from class:JdbcTypeMapper.DataTypeMappingGet a value from the current row in the given ResultSet and column and convert to the target type. If the source value is null, return the given default value. A Context object is provided for additional context or "settings" regarding how to perform the conversion (for example, the source time zone).- Specified by:
getObjectin classJdbcTypeMapper.DataTypeMapping<Integer>- Parameters:
resultSet- from which to extract the value.columnIndex- ResultSet column from which to extract the value (1-based).context- conversion context information.defaultValue- value to return in case the source value is null.- Returns:
- the converted value
- Throws:
SQLException- if an error occurs
-
bindObject
public void bindObject(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, Integer value) throws SQLException Description copied from class:JdbcTypeMapper.DataTypeMappingBind the given value to the given prepared statement. All concrete implementations must provide this method. If the given value is null or matches the Deephaven null-equivalent, it should be bound as SQL NULL.- Specified by:
bindObjectin classJdbcTypeMapper.DataTypeMapping<Integer>- Parameters:
stmt- statement to which to bind the given valueparameterIndex- parameter index to bindcontext- context information for the bindingvalue- value to bind- Throws:
SQLException- if an error occurs
-
bindInt
public void bindInt(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, int value) throws SQLException Description copied from class:JdbcTypeMapper.DataTypeMappingBind the given integer to the given prepared statement. Implementations should avoid boxing and bind QueryConstants.NULL_INT values as SQL NULL.- Overrides:
bindIntin classJdbcTypeMapper.DataTypeMapping<Integer>- Parameters:
stmt- statement to which to bind the given valueparameterIndex- parameter index to bindcontext- context information for the bindingvalue- value to bind- Throws:
SQLException- if an error occurs
-
columnSourceBinder
public JdbcTypeMapper.ColumnSourceBinder columnSourceBinder(ColumnSource columnSource, JdbcTypeMapper.Context context) Description copied from class:JdbcTypeMapper.DataTypeMappingProvides a function, via a lambda, that can be used to bind values from the given ColumnSource to a PreparedStatement.- Specified by:
columnSourceBinderin classJdbcTypeMapper.DataTypeMapping<Integer>- Parameters:
columnSource- the column source from which values will be extractedcontext- context information to use when binding- Returns:
- a ColumnSourceBinder
-
columnSourcePrevBinder
public JdbcTypeMapper.ColumnSourceBinder columnSourcePrevBinder(ColumnSource columnSource, JdbcTypeMapper.Context context) Description copied from class:JdbcTypeMapper.DataTypeMappingProvides a function, via a lambda, that can be used to bind previous values from the given ColumnSource to a PreparedStatement.- Specified by:
columnSourcePrevBinderin classJdbcTypeMapper.DataTypeMapping<Integer>- Parameters:
columnSource- the column source from which values will be extractedcontext- context information to use when binding- Returns:
- a ColumnSourceBinder
-