Package com.illumon.iris.utils
Class JdbcTypeMapper.TimeNanosDataTypeMapping
java.lang.Object
com.illumon.iris.utils.JdbcTypeMapper.DataTypeMapping<T>
com.illumon.iris.utils.JdbcTypeMapper.TimeDataTypeMappingBase<Long>
com.illumon.iris.utils.JdbcTypeMapper.TimeNanosDataTypeMapping
- Enclosing class:
- JdbcTypeMapper
public static class JdbcTypeMapper.TimeNanosDataTypeMapping extends JdbcTypeMapper.TimeDataTypeMappingBase<Long>
-
Method Summary
Modifier and Type Method Description void
bindLong(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, long nanos)
Bind the given long integer value to the given prepared statement.void
bindObject(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, Long nanos)
Bind the given value to the given prepared statement.long
getLong(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, long defaultValue)
Get a long value from the current row in the given ResultSet and column and convert to the target type.Long
getObject(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, Long 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.TimeDataTypeMappingBase
columnSourceBinder, columnSourcePrevBinder
Methods inherited from class com.illumon.iris.utils.JdbcTypeMapper.DataTypeMapping
bindByte, bindChar, bindDouble, bindFloat, bindInt, bindShort, getByte, getByte, getChar, getChar, getDbType, getDouble, getDouble, getFloat, getFloat, getInputType, getInt, getInt, getLong, getObject, getObject, getObject, getObjectCodec, getObjectCodecArguments, getObjectCodecArguments, getShort, getShort
-
Method Details
-
getLong
public long getLong(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, long defaultValue) throws SQLExceptionDescription copied from class:JdbcTypeMapper.DataTypeMapping
Get a long 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 long need implement this method.- Overrides:
getLong
in classJdbcTypeMapper.DataTypeMapping<Long>
- 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 Long getObject(ResultSet resultSet, int columnIndex, JdbcTypeMapper.Context context, Long 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<Long>
- 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
-
bindLong
public void bindLong(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, long nanos) throws SQLExceptionDescription copied from class:JdbcTypeMapper.DataTypeMapping
Bind the given long integer value to the given prepared statement. Implementations should avoid boxing and bind QueryConstants.NULL_LONG values as SQL NULL.- Overrides:
bindLong
in classJdbcTypeMapper.DataTypeMapping<Long>
- Parameters:
stmt
- statement to which to bind the given valueparameterIndex
- parameter index to bindcontext
- context information for the bindingnanos
- value to bind- Throws:
SQLException
- if an error occurs
-
bindObject
public void bindObject(PreparedStatement stmt, int parameterIndex, JdbcTypeMapper.Context context, Long nanos) 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<Long>
- Parameters:
stmt
- statement to which to bind the given valueparameterIndex
- parameter index to bindcontext
- context information for the bindingnanos
- value to bind- Throws:
SQLException
- if an error occurs
-