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 FieldDescriptor
protected GDSHelper
protected int
-
Method Summary
Modifier and TypeMethodDescriptionstatic FBField
createField
(FieldDescriptor fieldDescriptor, FieldDataProvider dataProvider, @Nullable GDSHelper gdsHelper, boolean cached) This is a factory method that creates appropriate instance of theFBField
class according to the SQL datatype.getAlias()
Returns the alias of the column as declared in XSQLVAR.getArray()
final BigDecimal
getBigDecimal
(int scale) getBlob()
boolean
byte
getByte()
byte[]
getBytes()
getClob()
protected final @NonNull DatatypeCoder
getDate()
Decimal<?>
Returns the value as a Decimal type.final <D extends Decimal<D>>
DgetDecimal
(@NonNull Class<D> targetType) double
protected final byte @Nullable []
float
getFloat()
int
getInt()
long
getLong()
getName()
Returns the name of the column as declared in the XSQLVAR.<T> T
getRef()
Returns the relation to which belongs column as declared in XSQLVAR.getRowId()
short
getShort()
getTime()
getTimestamp
(Calendar cal) final boolean
isNull()
void
setBigDecimal
(BigDecimal value) void
setBigInteger
(BigInteger value) final void
final void
setBinaryStream
(InputStream in, int length) final void
setBinaryStream
(InputStream in, long length) protected void
setBinaryStreamInternal
(InputStream in, long length) void
void
void
setBoolean
(boolean value) void
setByte
(byte value) void
setBytes
(byte[] value) final void
final void
setCharacterStream
(Reader in, int length) final void
setCharacterStream
(Reader in, long length) protected void
setCharacterStreamInternal
(Reader in, long length) void
void
final void
setConnection
(GDSHelper gdsHelper) void
void
void
setDecimal
(Decimal<?> decimal) Sets the value as a Decimal type.void
setDouble
(double value) protected final void
setFieldData
(byte @Nullable [] data) void
setFloat
(float value) void
setInteger
(int value) void
setLong
(long value) void
setNull()
void
void
void
setRequiredType
(int requiredType) Set the required type forgetObject()
conversion.void
void
setShort
(short value) void
void
void
void
setTimestamp
(Timestamp value) void
setTimestamp
(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:
true
if 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 theTypes
constants.
-
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 theFBField
class 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
-