java.lang.Object
org.firebirdsql.jdbc.field.FBField
- Direct Known Subclasses:
FBLongVarCharField
Base class for fields (for use by prepared statement and result set to represent columns and parameters).
- Author:
- Roman Rokytskyy, Mark Rotteveel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NonNull FieldDescriptorprotected GDSHelperprotected int -
Method Summary
Modifier and TypeMethodDescriptionstatic FBFieldcreateField(FieldDescriptor fieldDescriptor, FieldDataProvider dataProvider, @Nullable GDSHelper gdsHelper, boolean cached) This is a factory method that creates appropriate instance of theFBFieldclass according to the SQL datatype.getAlias()Returns the alias of the column as declared in XSQLVAR.getArray()final BigDecimalgetBigDecimal(int scale) getBlob()booleanbytegetByte()byte[]getBytes()getClob()protected final @NonNull DatatypeCodergetDate()Decimal<?>Returns the value as a Decimal type.final <D extends Decimal<D>>
DgetDecimal(@NonNull Class<D> targetType) doubleprotected final byte @Nullable []floatgetFloat()intgetInt()longgetLong()getName()Returns the name of the column as declared in the XSQLVAR.<T> TgetRef()Returns the relation to which belongs column as declared in XSQLVAR.getRowId()shortgetShort()getTime()getTimestamp(Calendar cal) final booleanisNull()voidsetBigDecimal(BigDecimal value) voidsetBigInteger(BigInteger value) final voidfinal voidsetBinaryStream(InputStream in, int length) final voidsetBinaryStream(InputStream in, long length) protected voidsetBinaryStreamInternal(InputStream in, long length) voidvoidvoidsetBoolean(boolean value) voidsetByte(byte value) voidsetBytes(byte[] value) final voidfinal voidsetCharacterStream(Reader in, int length) final voidsetCharacterStream(Reader in, long length) protected voidsetCharacterStreamInternal(Reader in, long length) voidvoidfinal voidsetConnection(GDSHelper gdsHelper) voidvoidvoidsetDecimal(Decimal<?> decimal) Sets the value as a Decimal type.voidsetDouble(double value) protected final voidsetFieldData(byte @Nullable [] data) voidsetFloat(float value) voidsetInteger(int value) voidsetLong(long value) voidsetNull()voidvoidvoidsetRequiredType(int requiredType) Set the required type forgetObject()conversion.voidvoidsetShort(short value) voidvoidvoidvoidsetTimestamp(Timestamp value) voidsetTimestamp(Timestamp value, Calendar cal)
-
Field Details
-
fieldDescriptor
-
gdsHelper
-
requiredType
protected int requiredType
-
-
Method Details
-
getFieldData
protected final byte @Nullable [] getFieldData() -
setFieldData
protected final void setFieldData(byte @Nullable [] data) -
getDatatypeCoder
-
isNull
- Returns:
trueif the corresponding field isnull, otherwisefalse- Throws:
SQLException
-
setNull
public void setNull() -
setConnection
-
setRequiredType
public void setRequiredType(int requiredType) Set the required type forgetObject()conversion.- Parameters:
requiredType- required type, one of theTypesconstants.
-
createField
@NullMarked public static FBField createField(FieldDescriptor fieldDescriptor, FieldDataProvider dataProvider, @Nullable GDSHelper gdsHelper, boolean cached) throws SQLException This is a factory method that creates appropriate instance of theFBFieldclass according to the SQL datatype. This instance knows how to perform all necessary type conversions.- Throws:
SQLException
-
getName
Returns the name of the column as declared in the XSQLVAR. -
getAlias
Returns the alias of the column as declared in XSQLVAR. -
getRelationName
Returns the relation to which belongs column as declared in XSQLVAR. -
getByte
- Throws:
SQLException
-
getShort
- Throws:
SQLException
-
getInt
- Throws:
SQLException
-
getLong
- Throws:
SQLException
-
getFloat
- Throws:
SQLException
-
getDouble
- Throws:
SQLException
-
getBigDecimal
- Throws:
SQLException
-
getBigDecimal
- Throws:
SQLException
-
getBoolean
- Throws:
SQLException
-
getString
- Throws:
SQLException
-
getObject
- Throws:
SQLException
-
getObject
- Throws:
SQLException
-
getObject
- Throws:
SQLException
-
getBinaryStream
- Throws:
SQLException
-
getCharacterStream
- Throws:
SQLException
-
getBytes
- Throws:
SQLException
-
getBlob
- Throws:
SQLException
-
getDate
- Throws:
SQLException
-
getDate
- Throws:
SQLException
-
getTime
- Throws:
SQLException
-
getTime
- Throws:
SQLException
-
getTimestamp
- Throws:
SQLException
-
getTimestamp
- Throws:
SQLException
-
getRef
- Throws:
SQLException
-
getClob
- Throws:
SQLException
-
getArray
- Throws:
SQLException
-
getBigInteger
- Throws:
SQLException
-
getRowId
- Throws:
SQLException
-
setByte
- Throws:
SQLException
-
setShort
- Throws:
SQLException
-
setInteger
- Throws:
SQLException
-
setLong
- Throws:
SQLException
-
setFloat
- Throws:
SQLException
-
setDouble
- Throws:
SQLException
-
setBigDecimal
- Throws:
SQLException
-
setBoolean
- Throws:
SQLException
-
setString
- Throws:
SQLException
-
setBigInteger
- Throws:
SQLException
-
setObject
- Throws:
SQLException
-
setObject
- Throws:
SQLException
-
setBinaryStreamInternal
- Throws:
SQLException
-
setBinaryStream
- Throws:
SQLException
-
setBinaryStream
- Throws:
SQLException
-
setBinaryStream
- Throws:
SQLException
-
setCharacterStreamInternal
- Throws:
SQLException
-
setCharacterStream
- Throws:
SQLException
-
setCharacterStream
- Throws:
SQLException
-
setCharacterStream
- Throws:
SQLException
-
setBytes
- Throws:
SQLException
-
setDate
- Throws:
SQLException
-
setDate
- Throws:
SQLException
-
setTime
- Throws:
SQLException
-
setTime
- Throws:
SQLException
-
setTimestamp
- Throws:
SQLException
-
setTimestamp
- Throws:
SQLException
-
setBlob
- Throws:
SQLException
-
setBlob
- Throws:
SQLException
-
setClob
- Throws:
SQLException
-
setClob
- Throws:
SQLException
-
setRowId
- Throws:
SQLException
-
getDecimal
Returns the value as a Decimal type.The default for this method is implemented in terms of
getBigDecimal(), and returning aDecimal128. Implementations may return aDecimal64(or evenDecimal32).- Returns:
- The value as decimal
- Throws:
SQLException- For database access errors, or values that cannot be converted.
-
getDecimal
- Throws:
SQLException
-
setDecimal
Sets the value as a Decimal type.The default for this method is implemented in terms of
setBigDecimal(BigDecimal).- Parameters:
decimal- Value to set- Throws:
SQLException
-