Package com.illumon.iris.utils
Class JdbcTypeMapper.DoubleDataTypeMapping
java.lang.Object
com.illumon.iris.utils.JdbcTypeMapper.DataTypeMapping<Double>
com.illumon.iris.utils.JdbcTypeMapper.DoubleDataTypeMapping
- Direct Known Subclasses:
JdbcTypeMapper.DecimalToDoubleDataTypeMapping
- Enclosing class:
- JdbcTypeMapper
public static class JdbcTypeMapper.DoubleDataTypeMapping extends JdbcTypeMapper.DataTypeMapping<Double>
-
Method Summary
Modifier and Type Method Description void
bindDouble(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, double value)
Bind the given double value to the given prepared statement.void
bindObject(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, Double value)
Bind the given value to the given prepared statement.JdbcTypeMapper.ColumnSourceBinder
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.JdbcTypeMapper.ColumnSourceBinder
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.double
getDouble(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, double defaultValue)
Get a double value from the current row in the given ResultSet and column and convert to the target type.Double
getObject(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, Double 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, bindFloat, bindInt, bindLong, bindShort, getByte, getByte, getChar, getChar, getDbType, getDouble, getFloat, getFloat, getInputType, getInt, getInt, getLong, getLong, getObject, getObject, getObject, getObjectCodec, getObjectCodecArguments, getObjectCodecArguments, getShort, getShort
-
Method Details
-
getDouble
public double getDouble(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, double defaultValue) throws SQLExceptionDescription copied from class:JdbcTypeMapper.DataTypeMapping
Get a double 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 double need implement this method.- Overrides:
getDouble
in classJdbcTypeMapper.DataTypeMapping<Double>
- 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 Double getObject(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, Double 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).- Specified by:
getObject
in classJdbcTypeMapper.DataTypeMapping<Double>
- 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
-
bindDouble
public void bindDouble(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, double value) throws SQLExceptionDescription copied from class:JdbcTypeMapper.DataTypeMapping
Bind the given double value to the given prepared statement. Implementations should avoid boxing and bind QueryConstants.NULL_DOUBLE values as SQL NULL.- Overrides:
bindDouble
in classJdbcTypeMapper.DataTypeMapping<Double>
- 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, Double 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.- Specified by:
bindObject
in classJdbcTypeMapper.DataTypeMapping<Double>
- 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.DataTypeMapping
Provides a function, via a lambda, that can be used to bind values from the given ColumnSource to a PreparedStatement.- Specified by:
columnSourceBinder
in classJdbcTypeMapper.DataTypeMapping<Double>
- 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.DataTypeMapping
Provides a function, via a lambda, that can be used to bind previous values from the given ColumnSource to a PreparedStatement.- Specified by:
columnSourcePrevBinder
in classJdbcTypeMapper.DataTypeMapping<Double>
- Parameters:
columnSource
- the column source from which values will be extractedcontext
- context information to use when binding- Returns:
- a ColumnSourceBinder
-