java.lang.Object
org.apache.arrow.adapter.jdbc.JdbcFieldInfo
This class represents the information about a JDBC ResultSet Field that is needed to construct an
ArrowType. Currently, this is:
- The JDBC
Typestype. - The nullability.
- The field's precision (used for
Types.DECIMALandTypes.NUMERICtypes). - The field's scale (used for
Types.DECIMALandTypes.NUMERICtypes).
-
Constructor Summary
ConstructorsConstructorDescriptionJdbcFieldInfo(int jdbcType) Builds aJdbcFieldInfousing only theTypestype.JdbcFieldInfo(int jdbcType, int precision, int scale) Builds aJdbcFieldInfofrom theTypestype, precision, and scale.JdbcFieldInfo(int jdbcType, int nullability, int precision, int scale) Builds aJdbcFieldInfofrom theTypestype, nullability, precision, and scale.Builds aJdbcFieldInfofrom the corresponding row from aDatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)ResultSet.JdbcFieldInfo(ResultSetMetaData rsmd, int column) Builds aJdbcFieldInfofrom the correspondingResultSetMetaDatacolumn. -
Method Summary
Modifier and TypeMethodDescriptionintThe column index for query column.intThe max number of characters for the column.intTheTypestype.intThe numeric precision, forTypes.NUMERICandTypes.DECIMALtypes.intgetScale()The numeric scale, forTypes.NUMERICandTypes.DECIMALtypes.The type name as reported by the database.intThe nullability.
-
Constructor Details
-
JdbcFieldInfo
public JdbcFieldInfo(int jdbcType) Builds aJdbcFieldInfousing only theTypestype. Do not use this constructor if the field type isTypes.DECIMALorTypes.NUMERIC; the precision and scale will be set to0.- Parameters:
jdbcType- TheTypestype.- Throws:
IllegalArgumentException- if jdbcType isTypes.DECIMALorTypes.NUMERIC.
-
JdbcFieldInfo
public JdbcFieldInfo(int jdbcType, int precision, int scale) Builds aJdbcFieldInfofrom theTypestype, precision, and scale. Use this constructor forTypes.DECIMALandTypes.NUMERICtypes.- Parameters:
jdbcType- TheTypestype.precision- The field's numeric precision.scale- The field's numeric scale.
-
JdbcFieldInfo
public JdbcFieldInfo(int jdbcType, int nullability, int precision, int scale) Builds aJdbcFieldInfofrom theTypestype, nullability, precision, and scale.- Parameters:
jdbcType- TheTypestype.nullability- The nullability. Must be one ofResultSetMetaData.columnNoNulls,ResultSetMetaData.columnNullable, orResultSetMetaData.columnNullableUnknown.precision- The field's numeric precision.scale- The field's numeric scale.
-
JdbcFieldInfo
Builds aJdbcFieldInfofrom the correspondingResultSetMetaDatacolumn.- Parameters:
rsmd- TheResultSetMetaDatato get the field information from.column- The column to get the field information for (on a 1-based index).- Throws:
SQLException- If the column information cannot be retrieved.NullPointerException- ifrsmdisnull.IllegalArgumentException- ifcolumnis out of bounds.
-
JdbcFieldInfo
Builds aJdbcFieldInfofrom the corresponding row from aDatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)ResultSet.- Parameters:
rs- TheResultSetto get the field information from.- Throws:
SQLException- If the column information cannot be retrieved.
-
-
Method Details
-
getJdbcType
public int getJdbcType()TheTypestype. -
isNullable
public int isNullable()The nullability. -
getPrecision
public int getPrecision()The numeric precision, forTypes.NUMERICandTypes.DECIMALtypes. -
getScale
public int getScale()The numeric scale, forTypes.NUMERICandTypes.DECIMALtypes. -
getColumn
public int getColumn()The column index for query column. -
getTypeName
The type name as reported by the database. -
getDisplaySize
public int getDisplaySize()The max number of characters for the column.
-