Package com.illumon.iris.utils
Class JdbcTypeMapper.DecimalToFloatDataTypeMapping
java.lang.Object
com.illumon.iris.utils.JdbcTypeMapper.DataTypeMapping<Float>
com.illumon.iris.utils.JdbcTypeMapper.FloatDataTypeMapping
com.illumon.iris.utils.JdbcTypeMapper.DecimalToFloatDataTypeMapping
- Enclosing class:
- JdbcTypeMapper
public static class JdbcTypeMapper.DecimalToFloatDataTypeMapping
extends JdbcTypeMapper.FloatDataTypeMapping
Provides a mapping from SQL decimal/numeric to Deephaven BigDecimal type.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bindFloat
(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, float value) Bind the given float value to the given prepared statement.void
bindObject
(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, Float value) Bind the given value to the given prepared statement.float
getFloat
(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, float defaultValue) Get a float 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, Float 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.FloatDataTypeMapping
columnSourceBinder, columnSourcePrevBinder
Methods inherited from class com.illumon.iris.utils.JdbcTypeMapper.DataTypeMapping
bindByte, bindChar, bindDouble, bindInt, bindLong, bindShort, getByte, getByte, getChar, getChar, getDbType, getDouble, getDouble, getFloat, getInputType, getInt, getInt, getLong, getLong, getObject, getObject, getObject, getObjectCodec, getObjectCodecArguments, getObjectCodecArguments, getShort, getShort
-
Method Details
-
getFloat
public float getFloat(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, float defaultValue) throws SQLException Description copied from class:JdbcTypeMapper.DataTypeMapping
Get a float 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 a float need implement this method.- Overrides:
getFloat
in classJdbcTypeMapper.FloatDataTypeMapping
- 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 Float getObject(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, Float defaultValue) throws SQLException Description copied from class:JdbcTypeMapper.DataTypeMapping
Get 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).- Overrides:
getObject
in classJdbcTypeMapper.FloatDataTypeMapping
- 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
-
bindFloat
public void bindFloat(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, float value) throws SQLException Description copied from class:JdbcTypeMapper.DataTypeMapping
Bind the given float value to the given prepared statement. Implementations should avoid boxing and bind QueryConstants.NULL_FLOAT values as SQL NULL.- Overrides:
bindFloat
in classJdbcTypeMapper.FloatDataTypeMapping
- 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
-
bindObject
public void bindObject(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, Float value) throws SQLException Description copied from class:JdbcTypeMapper.DataTypeMapping
Bind 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.- Overrides:
bindObject
in classJdbcTypeMapper.FloatDataTypeMapping
- 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
-