Package com.illumon.iris.utils
Class JdbcTypeMapper
java.lang.Object
com.illumon.iris.utils.JdbcTypeMapper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic interfaceA closure that can be used to bind a ColumnSource to the given PreparedStatement and parameter index.static classA catch-all bucket for settings used when converting Deephaven column values to and from JDBC values.static classAn abstraction for mapping a JDBC type to an Deephaven column type.static classstatic classstatic classstatic classstatic classProvides a SQL decimal/numeric to double precision Deephaven type mappingstatic classProvides a mapping from SQL decimal/numeric to Deephaven BigDecimal type.static classstatic classA mapping that converts SQL double precision floating point to Deephaven BigDecimalstatic classstatic classA mapping that converts SQL single precision floating point to Deephaven BigDecimalstatic classstatic classstatic classstatic classstatic classA mapping for backward compatibility, converts a string column to a double array with a specified delimiterstatic classA mapping for backward compatibility, converts a string column to a long array with a specified delimiterstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> JdbcTypeMapper.DataTypeMapping<T>getColumnTypeMapping(Class<? extends Connection> connClass, int type, Class<? extends T> deephavenDataType) Get type mapping for converting JDBC to/from Deephaven column type.static <T> JdbcTypeMapper.DataTypeMapping<T>getColumnTypeMapping(Class<? extends Connection> connClass, int type, Class<? extends T> deephavenDataType, boolean throwException) Get type mapping for converting JDBC to/from Deephaven column type.static <T> JdbcTypeMapper.DataTypeMapping<T>getColumnTypeMapping(Connection connection, ResultSetMetaData metaData, int column, Class<T> deephavenDataType) Get type mapping for converting JDBC to/from Deephaven column type.static <T> JdbcTypeMapper.DataTypeMapping<T>getColumnTypeMapping(Connection connection, ResultSetMetaData rs, String columnName, Class<T> deephavenDataType, boolean throwException) Get type mapping for converting JDBC to/from Deephaven column type.static <T> JdbcTypeMapper.DataTypeMapping<T>getColumnTypeMapping(ResultSet rs, String columnName, Class<T> deephavenDataType) Get type mapping for converting JDBC to/from Deephaven column type.static <T> JdbcTypeMapper.DataTypeMapping<T>getColumnTypeMapping(ResultSet rs, String columnName, Class<T> deephavenDataType, boolean throwException) Get type mapping for converting JDBC to/from Deephaven column type.getDefaultColumnTypeMapping(Connection connection, ResultSetMetaData metaData, String columnName) Get the default type mapping for converting JDBC/SQL values to/from a Deephaven column type.getDefaultColumnTypeMapping(ResultSet rs, String columnName) Get the default type mapping for converting JDBC/SQL values to/from a Deephaven column type.
-
Constructor Details
-
JdbcTypeMapper
public JdbcTypeMapper()
-
-
Method Details
-
getDefaultColumnTypeMapping
public static JdbcTypeMapper.DataTypeMapping getDefaultColumnTypeMapping(ResultSet rs, String columnName) Get the default type mapping for converting JDBC/SQL values to/from a Deephaven column type.- Parameters:
rs- JDBC ResultSet from which to extract type informationcolumnName- Name of the column- Returns:
- The default mapping for the specified column
-
getDefaultColumnTypeMapping
public static JdbcTypeMapper.DataTypeMapping getDefaultColumnTypeMapping(Connection connection, ResultSetMetaData metaData, String columnName) Get the default type mapping for converting JDBC/SQL values to/from a Deephaven column type.- Parameters:
connection- a JDBC Connection object, used to determine database-specific mappingsmetaData- a JDBC ResultSetMetaData object that will provide the SQL type informationcolumnName- the name of the JDBC ResultSet column- Returns:
- a mapping object that can be used to map SQL/JDBC ResultSet values to and from Deephaven column values
-
getColumnTypeMapping
public static <T> JdbcTypeMapper.DataTypeMapping<T> getColumnTypeMapping(ResultSet rs, String columnName, Class<T> deephavenDataType) Get type mapping for converting JDBC to/from Deephaven column type. If the target Deephaven type is not specified, a default will be used.- Type Parameters:
T- the target Deephaven type- Parameters:
rs- a JDBC ResultSet object that will provide the SQL type informationcolumnName- the name of the JDBC ResultSet columndeephavenDataType- if not null, the desired Deephaven target data type- Returns:
- a mapping object that can be used to map SQL/JDBC ResultSet values to and from Deephaven column values
-
getColumnTypeMapping
public static <T> JdbcTypeMapper.DataTypeMapping<T> getColumnTypeMapping(ResultSet rs, String columnName, Class<T> deephavenDataType, boolean throwException) Get type mapping for converting JDBC to/from Deephaven column type. If the target Deephaven type is not specified, a default will be used.- Type Parameters:
T- the target Deephaven type- Parameters:
rs- a JDBC ResultSet object that will provide the SQL type informationcolumnName- the name of the JDBC ResultSet columndeephavenDataType- if not null, the desired Deephaven target data typethrowException- if true, throw an exception if a mapping cannot be found. Otherwise, return null- Returns:
- a mapping object that can be used to map SQL/JDBC ResultSet values to and from Deephaven column values
-
getColumnTypeMapping
public static <T> JdbcTypeMapper.DataTypeMapping<T> getColumnTypeMapping(Connection connection, ResultSetMetaData metaData, int column, Class<T> deephavenDataType) Get type mapping for converting JDBC to/from Deephaven column type. If the target Deephaven type is not specified, a default will be used.- Type Parameters:
T- the target Deephaven type- Parameters:
connection- a JDBC Connection object, used to determine database-specific mappingsmetaData- a JDBC ResultSetMetaData object that will provide the SQL type informationcolumn- the JDBC ResultSetMetaData column indexdeephavenDataType- if not null, the desired Deephaven target data type- Returns:
- a mapping object that can be used to map SQL/JDBC ResultSet values to and from Deephaven column values
-
getColumnTypeMapping
public static <T> JdbcTypeMapper.DataTypeMapping<T> getColumnTypeMapping(Connection connection, ResultSetMetaData rs, String columnName, Class<T> deephavenDataType, boolean throwException) Get type mapping for converting JDBC to/from Deephaven column type. If the target Deephaven type is not specified, a default will be used.- Type Parameters:
T- the target Deephaven type- Parameters:
connection- a JDBC Connection object, used to determine database-specific mappingsrs- the JDBC ResultSetcolumnName- the column for which to find a type matchdeephavenDataType- if not null, the desired Deephaven target data typethrowException- if true, throw an exception if a mapping cannot be found. Otherwise, return null- Returns:
- a mapping object that can be used to map SQL/JDBC ResultSet values to and from Deephaven column values
-
getColumnTypeMapping
public static <T> JdbcTypeMapper.DataTypeMapping<T> getColumnTypeMapping(Class<? extends Connection> connClass, int type, Class<? extends T> deephavenDataType) Get type mapping for converting JDBC to/from Deephaven column type. If the target Deephaven type is not specified, a default will be used.- Type Parameters:
T- the target Deephaven type- Parameters:
connClass- a JDBC Connection subclass, used to determine database-specific mappingstype- the SQL typedeephavenDataType- if not null, the desired Deephaven target data type- Returns:
- a mapping object that can be used to map SQL/JDBC ResultSet values to and from Deephaven column values
-
getColumnTypeMapping
public static <T> JdbcTypeMapper.DataTypeMapping<T> getColumnTypeMapping(Class<? extends Connection> connClass, int type, Class<? extends T> deephavenDataType, boolean throwException) Get type mapping for converting JDBC to/from Deephaven column type. If the target Deephaven type is not specified, a default will be used.- Type Parameters:
T- the target Deephaven type- Parameters:
connClass- a JDBC Connection subclass, used to determine database-specific mappingstype- the SQL typedeephavenDataType- the column type, if known. If null, the default type mapping will be providedthrowException- if true, throw an exception if a mapping cannot be found. Otherwise, return null- Returns:
- a mapping object that can be used to map SQL/JDBC ResultSet values to and from Deephaven column values
-