Package com.illumon.iris.utils
Class JdbcTypeMapper.FloatToDecimalDataTypeMapping
java.lang.Object
com.illumon.iris.utils.JdbcTypeMapper.DataTypeMapping<BigDecimal>
com.illumon.iris.utils.JdbcTypeMapper.DecimalDataTypeMapping
com.illumon.iris.utils.JdbcTypeMapper.FloatToDecimalDataTypeMapping
- Enclosing class:
- JdbcTypeMapper
public static class JdbcTypeMapper.FloatToDecimalDataTypeMapping extends JdbcTypeMapper.DecimalDataTypeMapping
A mapping that converts SQL single precision floating point to Deephaven BigDecimal
-
Method Summary
Modifier and Type Method Description void
bindObject(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, BigDecimal value)
Bind the given value to the given prepared statement.BigDecimal
getObject(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, BigDecimal defaultValue)
Get a value from the current row in the given ResultSet and column and convert to the target type.String
getObjectCodec()
String
getObjectCodecArguments(ResultSetMetaData resultSetMetaData, String columnName)
Provide the proper object codec arguments for the given ResultSetMetaData column.Methods inherited from class com.illumon.iris.utils.JdbcTypeMapper.DecimalDataTypeMapping
columnSourceBinder, columnSourcePrevBinder
Methods inherited from class com.illumon.iris.utils.JdbcTypeMapper.DataTypeMapping
bindByte, bindChar, bindDouble, bindFloat, bindInt, bindLong, bindShort, getByte, getByte, getChar, getChar, getDbType, getDouble, getDouble, getFloat, getFloat, getInputType, getInt, getInt, getLong, getLong, getObject, getObject, getObject, getObjectCodecArguments, getShort, getShort
-
Method Details
-
getObject
public BigDecimal getObject(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, BigDecimal defaultValue) throws SQLExceptionDescription 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.DecimalDataTypeMapping
- 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
-
getObjectCodec
- Overrides:
getObjectCodec
in classJdbcTypeMapper.DecimalDataTypeMapping
-
getObjectCodecArguments
Description copied from class:JdbcTypeMapper.DataTypeMapping
Provide the proper object codec arguments for the given ResultSetMetaData column. This permits the codec to allocate the minimum space that will accommodate the SQL type details (i.e. precision and scale).- Overrides:
getObjectCodecArguments
in classJdbcTypeMapper.DecimalDataTypeMapping
- Parameters:
resultSetMetaData
- ResultSetMetaData to querycolumnName
- the column to query- Returns:
- codec arguments consistent with the codec class provided by
JdbcTypeMapper.DataTypeMapping.getObjectCodec()
-
bindObject
public void bindObject(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, BigDecimal value) throws SQLExceptionDescription 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.DecimalDataTypeMapping
- 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
-