Interface JdbcValueReader
public interface JdbcValueReader
The interface used to read column values from a JDBC ResultSet.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JdbcValueReaderDeprecated.static final JdbcValueReaderMaps database types to java types based only onjava.sql.Types, column display size, and scale.static final JdbcValueReaderstatic final JdbcValueReaderMaps database types to java types based only onjava.sql.Typesas defined by Sun/Oracle. -
Method Summary
Modifier and TypeMethodDescriptionreadColumnValue(ResultSet result, int columnIndex, int columnType, String columnName) Reads the 1-based column's value from the current row;columnTypeis the column'sTypescode.default ObjectreadColumnValue(ResultSet result, int columnIndex, int columnType, String columnName, FieldType fieldType) Reads the 1-based column's value from the current row as the given field type, returningnullfor SQL NULL; the default ignoresfieldTypeand calls the overload without it.default Class<?> sqlToJavaType(int sqlTypeIndex, int displaySize, int decimals, boolean nullable, boolean signed, String className)
-
Field Details
-
ORIGINAL
-
DEFAULT
Deprecated.useORIGINALto replicate the pre-8.0.0 default behavior. Maps database types to java types using the original DataPipeline algorithm. This mapping should no longer be used and replaced withOPINIONATED(orSTRICT) instead. -
STRICT
Maps database types to java types based only onjava.sql.Typesas defined by Sun/Oracle. Column display size and scale will not be considered for numeric types.- See Also:
-
OPINIONATED
Maps database types to java types based only onjava.sql.Types, column display size, and scale.- See Also:
-
-
Method Details
-
sqlToJavaType
default Class<?> sqlToJavaType(int sqlTypeIndex, int displaySize, int decimals, boolean nullable, boolean signed, String className) throws Throwable Returns the Java class used for a column with the givenTypescode, display size, scale (decimals) and other metadata; the default applies the pre-8.0.0 mapping ofORIGINAL.- Throws:
Throwable
-
readColumnValue
Object readColumnValue(ResultSet result, int columnIndex, int columnType, String columnName) throws Throwable Reads the 1-based column's value from the current row;columnTypeis the column'sTypescode.- Throws:
Throwable
-
readColumnValue
default Object readColumnValue(ResultSet result, int columnIndex, int columnType, String columnName, FieldType fieldType) throws Throwable Reads the 1-based column's value from the current row as the given field type, returningnullfor SQL NULL; the default ignoresfieldTypeand calls the overload without it.- Throws:
Throwable
-
ORIGINALto replicate the pre-8.0.0 default behavior.