Package org.firebirdsql.jdbc.field
Class FBField
java.lang.Object
org.firebirdsql.jdbc.field.FBField
- Direct Known Subclasses:
FBLongVarCharField,FBWorkaroundStringField
Describe class
FBField here.- Author:
- Roman Rokytskyy, Mark Rotteveel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FieldDescriptorprotected GDSHelperprotected intprotected int -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this field.static FBFieldcreateField(FieldDescriptor fieldDescriptor, FieldDataProvider dataProvider, 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()getBigDecimal(int scale) getBlob()booleanbytegetByte()byte[]getBytes()getClob()protected final DatatypeCodergetDate()Decimal<?>Returns the value as a Decimal type.final <D extends Decimal<D>>
DgetDecimal(Class<D> targetType) doubleprotected final byte[]floatgetFloat()intgetInt()longgetLong()getName()Returns the name of the column as declared in the XSQLVAR.<T> Tprotected final org.firebirdsql.jdbc.field.ObjectConvertergetRef()Returns the relation to which belongs column as declared in XSQLVAR.getRowId()shortgetShort()getTime()getTimestamp(Calendar cal) protected booleanfinal booleanisNull()static booleanisType(FieldDescriptor field, int jdbcType) Deprecated.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) voidvoidsetBoolean(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) voidvoidsetConnection(GDSHelper gdsHelper) voidvoidvoidsetDecimal(Decimal<?> decimal) Sets the value as a Decimal type.voidsetDouble(double value) protected final voidsetFieldData(byte[] 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 -
scale
protected int scale
-
-
Method Details
-
getFieldData
protected final byte[] getFieldData() -
setFieldData
protected final void setFieldData(byte[] data) -
getObjectConverter
protected final org.firebirdsql.jdbc.field.ObjectConverter getObjectConverter() -
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.
-
isType
Deprecated.This method will be removed in Jaybird 5, as a replacement useJdbcTypeConverter.isJdbcType(FieldDescriptor, int)- Returns:
trueif the field is of typetype.
-
createField
public static FBField createField(FieldDescriptor fieldDescriptor, FieldDataProvider dataProvider, 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. -
close
Close this field. This method tells field implementation to release all resources allocated when field methods were called.- Throws:
SQLException- if field cannot be closed.
-
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
-
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
-
setClob
- Throws:
SQLException
-
setRowId
- Throws:
SQLException
-
getRawDateTimeStruct
- Throws:
SQLException
-
setRawDateTimeStruct
- 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
-
isInvertTimeZone
protected boolean isInvertTimeZone()
-
JdbcTypeConverter.isJdbcType(FieldDescriptor, int)